How to tell if it's British Summer Time

前端 未结 4 477
猫巷女王i
猫巷女王i 2021-01-19 02:21

I have the following code, which should return an offset of 60 (to show that in the UK at present, we are in British Summer Time - ie. 60 minutes ahead of GMT):

4条回答
  •  梦毁少年i
    2021-01-19 02:45

    Your machine is not configured correctly if you get 0 and live in the UK. Probable causes are:

    • The machine's time zone is not set correctly. Click the clock on the taskbar to correct.
    • The machine is not configured to observe daylight savings. Click the clock.
    • The database that TimeZoneInfo consults for daylight savings rules in out of date or corrupted. It is stored in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones registry key.

    Be careful about making radical changes, having it configured wrong might well have been done intentionally to work around some kind of flaw in a business-critical app that runs on the server. Talk to whomever administers the server first.

提交回复
热议问题