Closed
Description
Running TimeZone.current
on Windows always returns GMT despite any present system settings.
This appears to be because on Windows we check TZDEFAULT
:
swift-foundation/Sources/FoundationEssentials/TimeZone/TimeZone_Cache.swift
Lines 116 to 131 in 5141cf6
However, TZDEFAULT
does not appear to be set in the WinSDK
/ucrt
modules so we instead pickup the default value from our CShims:
swift-foundation/Sources/_FoundationCShims/include/_CStdlib.h
Lines 151 to 157 in 5141cf6
These default paths seem unsuitable for Windows and result in us failing to detect the current timezone and falling back to GMT