You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Mac OS using both swift 4.2 and swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-06, it prints this:
1003-12-31 00:00:00 +0000
-30483648000.0
On Linux using swift-5.0-DEVELOPMENT-SNAPSHOT-2019-02-05-a-ubuntu18.04 it prints this:
1003-12-31 00:00:00 +0000
-30484166400.0
Somehow they both think it's the same date but the timeIntervalSince1970 is different by 6 days. The Mac OS one matches the numbers output by this website when using this code to convert dates to Julian format, but I have no idea if it's actually correct.
Note that while the output of print is consistent with each platform's DateFormatter, the Swift REPL's printout always matches the one on Linux, meaning that on Mac OS the REPL may print a different value than what you just inputted into the DateFormatter.
The text was updated successfully, but these errors were encountered:
This looks to be caused by the switch to the Gregorian calender on 4Oct 1582 where the date was bumped to 15th Oct and the dates 4-14 dont exist (see https://en.wikipedia.org/wiki/Gregorian_calendar)
This means that all dates since 15 Oct 1582 have the same timeIntervalSince1970 but before that it diverges. This can be seen with the following:
As to who is correct is subjective, but the Linux one (which uses ICU v61) is probably more consistent with expecting the timeIntervalSince1970 to reduce by approximately 86400 secs per day.
Additional Detail from JIRA
md5: ee3953366f931b0a27407face5fe0778
relates to:
Issue Description:
This code gets different results in Mac vs Linux
On Mac OS using both swift 4.2 and swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-06, it prints this:
On Linux using swift-5.0-DEVELOPMENT-SNAPSHOT-2019-02-05-a-ubuntu18.04 it prints this:
Somehow they both think it's the same date but the timeIntervalSince1970 is different by 6 days. The Mac OS one matches the numbers output by this website when using this code to convert dates to Julian format, but I have no idea if it's actually correct.
Note that while the output of print is consistent with each platform's DateFormatter, the Swift REPL's printout always matches the one on Linux, meaning that on Mac OS the REPL may print a different value than what you just inputted into the DateFormatter.
The text was updated successfully, but these errors were encountered: