DateTime Format issue

G

Guest

Hi Guys,

I want to get DateTime string format,
when I use DateTime.Now.ToString("HH:MM:SS"); it returns me
05:06:23, it is great. However, IF i want to display as PM or AM
How to set this? if I use ToString( "HH:MM ??") ?

Thanks
 
S

Steve

hi try:

DateTime.Now.ToString("HH:mm:ss tt") to give ie "20:18:54 PM"
DateTime.Now.ToString("hh:mm:ss tt") to give ie "08:18:54 PM"

steve.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top