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!

Functions UNIX_TIMESTAMP and FROM_UNIXTIME from MySQL to ORACLE

user7363538Jan 12 2015 — edited Jan 15 2015

Hi all,

I'm migrating some functions and stored procedures from MySQL to ORACLE, and I have the next instruction

set valuedat =  FROM_UNIXTIME( valor  +  UNIX_TIMESTAMP('2000-1-01 00:00:00'));

From MySQL.

Looking for I found that:

UNIX_TIMESTAMP('2000-1-01 00:00:00')

may be equivalent to the next query:

SELECT (to_date('01-jan-2000', 'DD-MON-YYYY') - to_date('01-jan-1970','DD-MON-YYYY')) * (86400) as dt FROM dual;

but testing the numbers are not the same

please somebody can help me!!

Specifically I need to know how to build the equivalent in oracle for the  functions  FROM_UNIXTIME and UNIX_TIMESTAMP

Thanks and regards!

//MGRC

This post has been answered by user7363538 on Jan 15 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2015
Added on Jan 12 2015
5 comments
4,471 views