Convert DateTime TimeZone from UTC
Posted on: Fri Jan 15 23:26:10 -0800 2010. Updated on: Fri Jan 15 23:26:50 -0800 2010.
Category: .NET C#
Category: .NET C#
This is pretty easy once you know what you are doing:
DateTime newYorkTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, TimeZoneInfo.FindTimeZoneById("US Eastern Standard Time"));
BTW it is a good idea to keep times in the database in UTC that way it is easy to convert using above.