Re: 24 hour clock problem

From: Tony <andrewst_at_onetel.net.uk>
Date: 28 Mar 2003 12:38:18 -0800
Message-ID: <c0e3f26e.0303281238.2813a64f_at_posting.google.com>


"Thomas Hough" <thomas.hough_at_dn.no> wrote in message news:<b61l9q$cnt$1_at_oslo-nntp.eunet.no>...
> I have a table with a date field into which I want to insert a date and
> time,
> the date format in my insert statement is like this: to_date('28.03.2003
> 14:43:10', 'DD.MM.RRRR HH24:MI:SS')
>
> I expected this to give me the time in 24 hour clock format, but the value
> for the time gets set to 02:43:10 PM, is there any way to get Oracle to
> store it as 14:43:10?

It will have stored the time correctly. Presumably by "the time gets set to 02:43:10 PM" you mean that some client tool displays it that way. Well, that's just because the client tool chose to use that format. Date/time is not stored in ANY "format", it is binary data. If your client tool is SQL PLus you can do this:

ALTER SESSION SET NLS_DATE_FORMAT='DD.MM.RRRR HH24:MI:SS'. For other tools, the answer will vary. Received on Fri Mar 28 2003 - 21:38:18 CET

Original text of this message