public
Created

Using the DebuggerDisplayAttribute to show the UTC and Local time of a DateTime property.

  • Download Gist
Issue.cs
C#
1 2 3 4 5 6 7 8 9 10 11
 
public class Issue
{
public Issue()
{
Created = DateTime.UtcNow;
}
 
[DebuggerDisplay("Local = {Created.ToLocalTime()}, UTC = {Created}")]
public DateTime Created { get; private set; }
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.