public static class Program
public static void Main()
DateTime nowUtc = DateTime.UtcNow;
Console.WriteLine(nowUtc);
Console.WriteLine(nowUtc.Kind.ToString());
DateTime cst = nowUtc.ToCSTDateTime();
Console.WriteLine(cst.Kind.ToString());
DateTime nowLocal = nowUtc.ToLocalTime();
Console.WriteLine(nowLocal);
Console.WriteLine(nowLocal.Kind.ToString());
Console.WriteLine("Is the UTC DateTime equal to the LOCAL DateTime: " + (nowUtc == nowLocal));
Console.WriteLine("Is the UTC DateTime equal to the CST DateTime: " + (nowUtc == cst));
Console.WriteLine("Is the CST DateTime equal to the LOCAL DateTime: " + (cst == nowLocal));
public static DateTime ToCSTDateTime(this DateTime dateTime)
return TimeZoneInfo.ConvertTimeFromUtc(dateTime, TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"));