Getting current GMT time

前端 未结 6 2107
鱼传尺愫
鱼传尺愫 2020-12-28 11:46

Is there a method in C# that returns the UTC (GMT) time zone? Not based on the system\'s time.

Basically I want to get the correct UTC time even if my system time is

6条回答
  •  攒了一身酷
    2020-12-28 12:42

    Not based on the system's time? You'd need to make a call to a network time service or something similar. You could write an NTP client, or just screenscrape World Clock ;)

    I don't believe .NET has an NTP client built in, but there are quite a few available.

提交回复
热议问题