Monday, June 25, 2012

Oracle DB dates

Official Doc on DATE datatype:

http://docs.oracle.com/cd/B19306_01/server.102/b14220/datatype.htm#i1847

Use TO_CHAR(mydate, 'MM/DD/YYYY HH24:MI:SS') to display the Date

WARNING: when you export your tables in Oracle SQL Developer using the "INSERT" format, DATE columns are TRUNCATED to midnigth, with a to_date('22-JUN-12','DD-MON-RR') statement.


Use
TO_DATE('2012-08-13 11.20.00', 'YYYY-MM-DD HH24:MI:SS')

to do the opposite conversion

No comments: