Conversion of MilliSeconds to Timestamp
436331Jan 13 2005 — edited Jan 13 2005Hi,
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?