Return to Snippet

Revision: 30114
at August 8, 2010 01:39 by derebus


Initial Code
DateTime d = DateTime.Now;

// 12 hour format
Response.Write(d.ToString("hh:mm") + " | " );

// 24 hour format
Response.Write(d.ToString("H:mm"));

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

Initial Description
Como convertir tiempo a formato de 24 horas y viceversa.

Initial Title
How to convert a Time in 24 hours format?

Initial Tags
format, convert

Initial Language
C#