Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Conversion of MilliSeconds to Timestamp

436331Jan 13 2005 — edited Jan 13 2005
Hi,
I'm using Oracle 10g. I want to convert a millisecond value to its corresponding Timestamp. For a millisecond value of 1093853934771 I get the corresponding unix timestamp as 2004-08-30 04:18:54 in mysql using the function FROM_UNIXTIME.

I tried the following in oracle: Adding the milliseconds to the epoch value of 1970-01-01 00:00:00. But got an error.

SQL> select to_timestamp('1970-01-01 00:00:00', 'yyyy-dd-mm hh24:mi:ss') - (1093853934771/1000) SECONDS from dual;
select to_timestamp('1970-01-01 00:00:00', 'yyyy-dd-mm hh24:mi:ss') - (1093853934771/1000) SECONDS from dual
*
ERROR at line 1:
ORA-01841: (full) year must be between -4713 and +9999, and not be 0

Can anyone tell me how to solve this? How will I get the same value of timestamp in Oracle also?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 10 2005
Added on Jan 13 2005
1 comment
2,824 views