Home » SQL & PL/SQL » SQL & PL/SQL » how to get A.M./ P.M. using to_char function? (Oracle 9i)
how to get A.M./ P.M. using to_char function? [message #311107] Thu, 03 April 2008 07:24 Go to next message
arunsuresh100
Messages: 38
Registered: December 2006
Member
Hi All,
I need to get AM/PM along with the time and date. I am using to_char function with time HH24:MI:SS, but it is not displaying AM/PM.
Request your help to solve the problem?

Thanks and Regards,
Arun
Re: how to get A.M./ P.M. using to_char function? [message #311109 is a reply to message #311107] Thu, 03 April 2008 07:31 Go to previous messageGo to next message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
You are using a 24 hour clock format.
format models

[Edit MC: fix URL]

[Updated on: Thu, 03 April 2008 07:35] by Moderator

Report message to a moderator

Re: how to get A.M./ P.M. using to_char function? [message #311184 is a reply to message #311109] Thu, 03 April 2008 11:43 Go to previous messageGo to next message
rajatratewal
Messages: 507
Registered: March 2008
Location: INDIA
Senior Member
select to_char(sysdate,'DD/MM/YYYY HH:MI:SS AM') from dual
Re: how to get A.M./ P.M. using to_char function? [message #311193 is a reply to message #311184] Thu, 03 April 2008 12:17 Go to previous message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Don't put solution only hint or clue as requested in OraFAQ Forum Guide, "Responding to Posts" section:
Quote:
When responding to questions, if it is obviously a student with a homework assignment or someone else just learning, especially in the homework and newbies forums, it is usual to provide hints or clues, perhaps links to relevant portions of the documentation, or a similar example, to point them in the right direction so that they will research and experiment on their own and learn, and not provide complete solutions to problems. In cases where someone has a real-life complex work problem, or at least it may seem complex to them, it may be best to provide a complete demo and explanation.


Regards
Michel
Previous Topic: Performance Degrade when ported from 9i to 10g
Next Topic: help with select statement
Goto Forum:
  


Current Time: Fri Feb 07 09:20:59 CST 2025