Click here to Skip to main content
15,902,447 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi All

i need some help...... how i can get the (AM,PM) from the date, as we get the date from DateTime.Now.GetDate()?

thank,,
Posted

You can check the hour property, if it's > 12, it's PM

Why would you call GetDate ?
 
Share this answer
 
Why dont u use

DateTime.Now.ToString ()
 
Share this answer
 
I think tt will place AM/PM

For Example :

DateTime.Now.ToString("MM/dd/yyyy hh:mm tt");
will produce 12/21/2009 02:30 PM

:)
 
Share this answer
 
Hi,

Is this the menaka who did her BSc Comp Sc in Ethiraj?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900