C# DateTime, is this method regional setting safe?

Posted by JL on Stack Overflow See other posts from Stack Overflow or by JL
Published on 2010-04-21T10:51:04Z Indexed on 2010/04/21 10:53 UTC
Read the original article Hit count: 164

Filed under:
|

I am using the following method to serialize a date as a string

private const string DateFormatString = "dd.MM.yyyy HH:mm:ss";
string LastsuccessfuldownloadDateTime = DateTime.Now.AddDays(-91).ToString(DateFormatString);

Is this the safest way to ensure that the string always gets serialized in this format?

© Stack Overflow or respective owner

Related posts about c#

Related posts about datetime