Posted By

derebus on 08/08/10


Tagged

time format convert hours 24


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Vordreller
Tyster


How to convert a Time in 24 hours format?


 / Published in: C#
 

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

Como convertir tiempo a formato de 24 horas y viceversa.

  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"));

Report this snippet  

You need to login to post a comment.