Home » SQL & PL/SQL » SQL & PL/SQL » Oracle Date / Time Zone Conversion (Oracle 11g)
Oracle Date / Time Zone Conversion [message #563427] Mon, 13 August 2012 14:11 Go to next message
dgloeppky
Messages: 26
Registered: May 2010
Junior Member
I would like to know how to convert the following:

13-AUG-12 03.30.06.146 PM

to the format:

"MM/DD/YYYY HH:MI:SS AM"... I believe there is a time zone issue here as well, since
the should actually be around 11:30am. I am not sure what time zone is being used.

Cheers,
David

Re: Oracle Date / Time Zone Conversion [message #563429 is a reply to message #563427] Mon, 13 August 2012 14:28 Go to previous messageGo to next message
BlackSwan
Messages: 21945
Registered: January 2009
Senior Member
  1* select to_char(to_timestamp('13-AUG-12 03.30.06.146 PM','DD-MON-RR HH.MI.SS.FF3 PM'),'MM/DD/YY HH:MI:SS') FROM  dual
12:27:42 SQL> /

TO_CHAR(TO_TIMEST
-----------------
08/13/12 03:30:06
Re: Oracle Date / Time Zone Conversion [message #563466 is a reply to message #563429] Tue, 14 August 2012 01:37 Go to previous message
Michel Cadot
Messages: 57611
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> select to_char(to_timestamp('13-AUG-12 03.30.06.146 PM','DD-MON-RR HH.MI.SS.FF3 PM'),'MM/DD/YY HH:MI:SS AM') 
  2  from dual
  3  /
TO_CHAR(TO_TIMESTAMP
--------------------
08/13/12 03:30:06 PM

Quote:
I am not sure what time zone is being used.

If you are not how could we know?

Regards
Michel
Previous Topic: *WITH AS* (alternatives) other methods (2 threads merged by bb)
Next Topic: multiple recipients using UTL_SMTP package
Goto Forum:
  


Current Time: Sat Apr 19 00:13:22 CDT 2014

Total time taken to generate the page: 0.08978 seconds