I am using TO_CHAR(last_used) to retrieve the date in String format from Oracle Database 11g. The output I get when I run the query: SELECT last_used, TO_CHAR(last_user, 'yyyy-MM-dd hh:mm:ss') as dtime1 FROM mytable WHERE id='120000'; is:
LAST_USED
---------------------------------------------------------------------------
DTIME1
-------------------
17-MAY-12 11.53.28.000000 PM -07:00
2012-05-17 11:05:28
Could any one let me know why this is happening?
MM is the format for month. Use MI for the minutes.