Unix Technical Forum

Obtain server timestamp

This is a discussion on Obtain server timestamp within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi! I need to obtain the server current timestamp. I know that some selects like "SELECT CURRENT_TIMESTAMP FROM dual;" ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 09:05 AM
=?iso-8859-1?B?TWVscXXtYWRlcw==?=
 
Posts: n/a
Default Obtain server timestamp

Hi!
I need to obtain the server current timestamp. I know that some selects
like "SELECT CURRENT_TIMESTAMP FROM dual;" gives the current
timestamp, but with a non standard format (10-Sep-05 10.58.24.853421 PM
-07:00) . I need a timestamp on numeric format type, like this
"1139865932".
How can I do it?
Thanks!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 09:05 AM
Michel Cadot
 
Posts: n/a
Default Re: Obtain server timestamp


"Melquíades" <srsuarez@gmail.com> a écrit dans le message de news: 1143313771.311129.14090@u72g2000cwu.googlegroups.c om...
| Hi!
| I need to obtain the server current timestamp. I know that some selects
| like "SELECT CURRENT_TIMESTAMP FROM dual;" gives the current
| timestamp, but with a non standard format (10-Sep-05 10.58.24.853421 PM
| -07:00) . I need a timestamp on numeric format type, like this
| "1139865932".
| How can I do it?
| Thanks!
|

You can easely do it if you know the base of your number.
What does 0 mean?

Regards
Michel Cadot


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 09:05 AM
Jim Kennedy
 
Posts: n/a
Default Re: Obtain server timestamp


"Melquíades" <srsuarez@gmail.com> wrote in message
news:1143313771.311129.14090@u72g2000cwu.googlegro ups.com...
> Hi!
> I need to obtain the server current timestamp. I know that some selects
> like "SELECT CURRENT_TIMESTAMP FROM dual;" gives the current
> timestamp, but with a non standard format (10-Sep-05 10.58.24.853421 PM
> -07:00) . I need a timestamp on numeric format type, like this
> "1139865932".
> How can I do it?
> Thanks!
>


Don't people even TRY reading documentation anymore? go to otn.oracle.com
and click on documentation. Go to the SQL Reference guide and look at the
table of contents. Look at format models and timestamps.
You would be amazed at the wealth of information there.
Jim


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-08-2008, 09:05 AM
Mark D Powell
 
Posts: n/a
Default Re: Obtain server timestamp

Melquíades, I believe that the default format that Oracle uses to
return a timestamp in is per the ANSI standard. Per a book I have
the standard format for a timestamp is'yyyy-mm-dd hh24:mi:ss.ffffff'
It is the numeric value that is non-standard.

HTH-- Mark D Powell --

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-08-2008, 09:05 AM
Mark C. Stock
 
Posts: n/a
Default Re: Obtain server timestamp


"Melquíades" <srsuarez@gmail.com> wrote in message
news:1143313771.311129.14090@u72g2000cwu.googlegro ups.com...
: Hi!
: I need to obtain the server current timestamp. I know that some selects
: like "SELECT CURRENT_TIMESTAMP FROM dual;" gives the current
: timestamp, but with a non standard format (10-Sep-05 10.58.24.853421 PM
: -07:00) . I need a timestamp on numeric format type, like this
: "1139865932".
: How can I do it?
: Thanks!
:

conversion and formatting functions are available as others have indicated,
but you may want to take a closer look at why you 'need' to convert a
timestamp to an offset -- are there other programs that need to be
integrated with the Oracle database applications that absolutely require the
offset value? if not, it would likely be best to treat Oracle timestamp
values as actual timestamp values and not convert them to another data type.

++ mcs


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-08-2008, 09:05 AM
=?iso-8859-1?B?TWVscXXtYWRlcw==?=
 
Posts: n/a
Default Re: Obtain server timestamp

Yes, I use other program that connects to my Oracle that require the
offset value. That is the problem.
I took a look at otn.oracle.com, but I don't find the solution.
Thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-08-2008, 09:05 AM
DA Morgan
 
Posts: n/a
Default Re: Obtain server timestamp

Melquíades wrote:
> Hi!
> I need to obtain the server current timestamp. I know that some selects
> like "SELECT CURRENT_TIMESTAMP FROM dual;" gives the current
> timestamp, but with a non standard format (10-Sep-05 10.58.24.853421 PM
> -07:00) . I need a timestamp on numeric format type, like this
> "1139865932".
> How can I do it?
> Thanks!


Write your own function.
--
Daniel A. Morgan
http://www.psoug.org
damorgan@x.washington.edu
(replace x with u to respond)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:30 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com