How do I say what is the current UTC in eastern zo

2020-05-07 03:47发布

No matter what server is being used, I want a way to be able to just get the Eastern UTC time. All my timestamps in the system is setup for est, but my Azure server is set to UTC, but my local dev box and staging site is on est. What is the best way? Thanks for any help.

var estZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
var utcTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now, estZone);

1条回答
走好不送
2楼-- · 2020-05-07 04:26

UTC is UTC. It is the same everywhere.

查看更多
登录 后发表回答