Skip to content

Instantly share code, notes, and snippets.

@Pilchie
Created July 20, 2012 06:59
Show Gist options
  • Save Pilchie/3149169 to your computer and use it in GitHub Desktop.
Save Pilchie/3149169 to your computer and use it in GitHub Desktop.
"RoundTrip" format for DateTime
using System.Globalization;
var dt = DateTime.UtcNow;
var dt2 = DateTime.ParseExact(dt.ToString("o", CultureInfo.InvariantCulture), "o", CultureInfo.InvariantCulture);
Console.WriteLine(dt == dt2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment