How to convert a Time in 24 hours format?


/ Published in: C#
Save to your folder(s)

Como convertir tiempo a formato de 24 horas y viceversa.


Copy this code and paste it in your HTML
  1. DateTime d = DateTime.Now;
  2.  
  3. // 12 hour format
  4. Response.Write(d.ToString("hh:mm") + " | " );
  5.  
  6. // 24 hour format
  7. Response.Write(d.ToString("H:mm"));

URL: http://www.dotnetfunda.com/forums/thread638-how-to-convert-a-time-in-24-hours-format.aspx

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.