Click here to Skip to main content
15,849,130 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
how to convert utc time to 24 hours format in HH:MM:SS?
DamithSL 16-Jan-15 11:29am    
how you hold utc time in your program?

Custom Date and Time Format Strings[^]:
string formattedDate = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss");
// Example output: 2015-01-16 16:26:32
Share this answer
Sergey Alexandrovich Kryukov 16-Jan-15 12:14pm    
5ed, but I also added background information with links in Solution 2.
In addition to Solution 1:

Please see all related methods:[^].

What you need is formatting. is not "conversion". Note that parameters allows you to format depending on culture (System.Globalization.CultureInfo implements IFormatProvider;[^]) or format string:[^],[^],
see also[^].

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900