Reputation: 551
I am new to Oracle, and I need to save date and time in an Oracle database.
I am using time stamp as datatype for row. But now my problem is it saves date and time in 12 hours format like this 17/11/2011 10:10:10 PM
.
But I need it in 24 hours format like 17/11/2011 22:10:10
. I didn't understand the results that Google search result provided. Can any one please help me by posting some code.
Upvotes: 5
Views: 38272
Reputation: 231661
Oracle always stores timestamps (and dates) in a packed binary format that is not human readable. Formatting is done only when a timestamp (or a date) is converted to a string.
You can control the formatting of your output by coding an explicit to_char
. For example
SELECT to_char( your_timestamp_column, 'DD/MM/YYYY HH24:MI:SS' )
FROM your_table
Upvotes: 15