Time zone conversion in C#

前端 未结 2 701
既然无缘
既然无缘 2021-01-21 15:59

I have a date format, something similar to:

Mon, 11 Aug 2009 13:15:10 GMT

How do I convert this to EST format?

2条回答
  •  失恋的感觉
    2021-01-21 16:42

    var datetime = DateTime.Parse("Sat, 21 Aug 2010 13:15:10 GMT");
    TimeZoneInfo estZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
    DateTime estTime = TimeZoneInfo.ConvertTime(datetime, estZone);
    

    EST can mean different times, which do you want: http://en.wikipedia.org/wiki/EST

提交回复
热议问题