/// <summary>
/// The ISO 8601 format string.
/// </summary>
private const string Iso8601Format = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'";
//SortableDateTimePattern (ISO 8601)
public static string ToIso8601(DateTime value)
{
return value.ToUniversalTime().ToString(Iso8601Format, CultureInfo.InvariantCulture);
}
public static DateTime ParseIso8601(string value)
{
return DateTime.ParseExact(value,
Iso8601Format, CultureInfo.InvariantCulture,
DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal);
}
Sunday, May 02, 2010
The ISO 8601 format string
at 10:44 AM Posted by roni schuetz
Labels: C#, code sample
Subscribe to:
Post Comments (Atom)
Shared Cache - .Net Caching made easy
All information about Shared Cache is available here: http://www.sharedcache.com/. Its free and easy to use, we provide all sources at codeplex.
No comments:
Post a Comment