Monday, October 18, 2010

Parsing DateTime's into UTC

This article proved helpful - http://www.mindthe.net/devices/2008/05/23/tryparseexact-and-utc-datetime/

But actually I think the answer is to use BOTH AssumeUniversal AND AdjustToUniversal
            DateTime.TryParseExact(group.Value, this.customParseText, CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.AdjustToUniversal | System.Globalization.DateTimeStyles.AdjustToUniversal, out dateTime);

No comments:

Post a Comment