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;" ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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! |
| |||
| "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 |
| |||
| "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 |
| |||
| 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 -- |
| |||
| "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 |
| ||||
| 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) |