Reputation: 1
When I do the following in macOS bash it returns the wrong Time Zone Information
Input macOS
TZ="Asia/Yakutsk" date -j -f "%Y:%m:%d %H:%M:%S%z" "2014:09:28 14:46:56+1000" +"%Y:%m:%d %H:%M:%S%z"
Output macOS
2014:09:28 14:46:56+0900
Conversely in bash on Debian Linux
TZ="Asia/Yakutsk" date --date "2014-09-28 14:46:56+1000" +"%Y:%m:%d %H:%M:%S%z"
2014:09:28 14:46:56+1000
Anybody else experienced such timezone conversion bugs (+0900 versus +1000)? IMHO back in 2014 the timezone setting for Russia was still UTC+10 (according to https://en.wikipedia.org/wiki/Yakutsk_Time)
Thanks for thoughts / hints, J
PS: After @KamilCuk 's hint,
Output on Linux
Asia/Yakutsk Fri Dec 13 20:45:52 1901 UT = Sat Dec 14 05:24:50 1901 LMT isdst=0 gmtoff=31138
Asia/Yakutsk Sat Dec 14 20:45:52 1901 UT = Sun Dec 15 05:24:50 1901 LMT isdst=0 gmtoff=31138
Asia/Yakutsk Sat Mar 27 16:59:59 2010 UT = Sun Mar 28 01:59:59 2010 +09 isdst=0 gmtoff=32400
Asia/Yakutsk Sat Mar 27 17:00:00 2010 UT = Sun Mar 28 03:00:00 2010 +10 isdst=1 gmtoff=36000
Asia/Yakutsk Sat Oct 30 16:59:59 2010 UT = Sun Oct 31 02:59:59 2010 +10 isdst=1 gmtoff=36000
Asia/Yakutsk Sat Oct 30 17:00:00 2010 UT = Sun Oct 31 02:00:00 2010 +09 isdst=0 gmtoff=32400
Asia/Yakutsk Sat Mar 26 16:59:59 2011 UT = Sun Mar 27 01:59:59 2011 +09 isdst=0 gmtoff=32400
Asia/Yakutsk Sat Mar 26 17:00:00 2011 UT = Sun Mar 27 03:00:00 2011 +10 isdst=0 gmtoff=36000
Asia/Yakutsk Sat Oct 25 15:59:59 2014 UT = Sun Oct 26 01:59:59 2014 +10 isdst=0 gmtoff=36000
Asia/Yakutsk Sat Oct 25 16:00:00 2014 UT = Sun Oct 26 01:00:00 2014 +09 isdst=0 gmtoff=32400
Asia/Yakutsk Mon Jan 18 03:14:07 2038 UT = Mon Jan 18 12:14:07 2038 +09 isdst=0 gmtoff=32400
Asia/Yakutsk Tue Jan 19 03:14:07 2038 UT = Tue Jan 19 12:14:07 2038 +09 isdst=0 gmtoff=32400
Output on macOS
.
.
Asia/Yakutsk Sat Oct 30 17:00:00 1999 UTC = Sun Oct 31 02:00:00 1999 +09 isdst=0
Asia/Yakutsk Sat Mar 25 16:59:59 2000 UTC = Sun Mar 26 01:59:59 2000 +09 isdst=0
Asia/Yakutsk Sat Mar 25 17:00:00 2000 UTC = Sun Mar 26 03:00:00 2000 +10 isdst=1
Asia/Yakutsk Sat Oct 28 16:59:59 2000 UTC = Sun Oct 29 02:59:59 2000 +10 isdst=1
Asia/Yakutsk Sat Oct 28 17:00:00 2000 UTC = Sun Oct 29 02:00:00 2000 +09 isdst=0
.
.
Asia/Yakutsk Sat Mar 24 16:59:59 2007 UTC = Sun Mar 25 01:59:59 2007 +09 isdst=0
Asia/Yakutsk Sat Mar 24 17:00:00 2007 UTC = Sun Mar 25 03:00:00 2007 +10 isdst=1
Asia/Yakutsk Sat Oct 27 16:59:59 2007 UTC = Sun Oct 28 02:59:59 2007 +10 isdst=1
Asia/Yakutsk Sat Oct 27 17:00:00 2007 UTC = Sun Oct 28 02:00:00 2007 +09 isdst=0
Asia/Yakutsk Sat Mar 29 16:59:59 2008 UTC = Sun Mar 30 01:59:59 2008 +09 isdst=0
Asia/Yakutsk Sat Mar 29 17:00:00 2008 UTC = Sun Mar 30 03:00:00 2008 +10 isdst=1
Asia/Yakutsk Sat Oct 25 16:59:59 2008 UTC = Sun Oct 26 02:59:59 2008 +10 isdst=1
Asia/Yakutsk Sat Oct 25 17:00:00 2008 UTC = Sun Oct 26 02:00:00 2008 +09 isdst=0
Asia/Yakutsk Sat Mar 28 16:59:59 2009 UTC = Sun Mar 29 01:59:59 2009 +09 isdst=0
Asia/Yakutsk Sat Mar 28 17:00:00 2009 UTC = Sun Mar 29 03:00:00 2009 +10 isdst=1
Asia/Yakutsk Sat Oct 24 16:59:59 2009 UTC = Sun Oct 25 02:59:59 2009 +10 isdst=1
Asia/Yakutsk Sat Oct 24 17:00:00 2009 UTC = Sun Oct 25 02:00:00 2009 +09 isdst=0
Asia/Yakutsk Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 12:14:07 2038 +09 isdst=0
Asia/Yakutsk Tue Jan 19 03:14:07 2038 UTC = Tue Jan 19 12:14:07 2038 +09 isdst=0
Upvotes: 0
Views: 488
Reputation: 141190
Output on macOS
Asia/Yakutsk Sat Oct 24 17:00:00 2009 UTC = Sun Oct 25 02:00:00 2009 +09 isdst=0 Asia/Yakutsk Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 12:14:07 2038 +09 isdst=0
Your macos timezone information is outdated or invalid. Possible cause is that your system is outdated and you should update your tzdata
package.
A 5 min search on google shows me multiple links on how to manually update tzdata database on MacOS. If a route of some "system update" is not available, then manually compile and install tzdata for /usr/share/zoneinfo/Asia/Yakutsk
.
Upvotes: 1