Skip to content

Commit 3a4e7fb

Browse files
authored
Merge pull request #2001 from compnerd/ill-put-you-on-my-calendar
NSTimeZone: use the android path on Windows
2 parents e12c2d8 + 99b8d19 commit 3a4e7fb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Foundation/NSTimeZone.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,17 @@ open class NSTimeZone : NSObject, NSCopying, NSSecureCoding, NSCoding {
2929
}
3030

3131
public init?(name tzName: String, data aData: Data?) {
32-
#if os(Android)
32+
#if os(Android) || os(Windows)
3333
var tzName = tzName
3434
if tzName == "UTC" || tzName == "GMT" {
3535
tzName = "GMT+0000"
3636
}
3737
else if !(tzName.hasPrefix("GMT+") || tzName.hasPrefix("GMT-")) {
38+
#if os(Android)
3839
NSLog("Time zone database not available on Android")
40+
#else
41+
NSLog("Time zone database not available on Windows")
42+
#endif
3943
}
4044
#endif
4145
super.init()

0 commit comments

Comments
 (0)