Click here to Skip to main content
15,889,034 members

Response to: how to get the full date from DateTime in windows application

Revision 2
Hi,

take a look at DateTime.ToLongDateString() and ToLongTimeStamp()

C#
DateTime d = DateTime.Now;
string s = d.ToLongDateString() + " " + d.ToLongTimeString();

In en-US it will result in
Wednesday, October 10, 2012 7:44:40 AM


and in de-DE it will result in
Mittwoch, 10. Oktober 2012 07:46:56


If you're using these methods, the time format will allways be correct regarding the current culture.
Posted 9-Oct-12 19:45pm by Andy411.
Tags: , , ,