Reputation: 109
SELECT
TO_CHAR((current_timestamp), 'YYYY-MM-DD HH:MM:SS AM') AS curr_time, current_timestamp, dbtimezone
FROM dual;
The result is:
curr_time 2014-05-22 12:05:23 PM
current_timestamp 22-MAY-14 12.39.23.447181000 PM ASIA/CALCUTTA
dbtimezone +00:00
why do curr_time and current_timestamp differ by minutes?
Upvotes: 2
Views: 22983
Reputation: 60493
because MM
are month, not minutes... (and 05 is... may)
You have to use MI
Change your format to
'YYYY-MM-DD HH:MI:SS AM'
Upvotes: 8