Date in 24h format

Discussion in 'ASP.NET / ASP.NET Core' started by Kosmik, Apr 2, 2009.

  1. Hello, I'm displaying a date in my guestbook but i want to display it in the 24 hour format. For example : 02-04-2009 21:09 and not 02-04-2009 09:09.
    I use the following code now :

    dtDateInAmerica.ToString("dd-MM-yyyy hh:mm tt") Can anyone help me out ?
     
  2. the correct format is:

    dtDateInAmerica.ToString("dd-MM-yyyy HH:mm tt")

    because H( 24 h) and h(12 h)

    Kind Regards,
    Javier
     
  3. Thanks Javier, that did the job :D Sometimes it can be very easy :)
     

Share This Page