I'm getting settled on mac os and some of my scripts are not working after linux. One script in particular is very interesting.
So i'm trying to convert ISO8601 date to unix epoch. OSX native way to do it seems to be
$ date -j -f "%FT%TZ" "2015-09-09T13:19:09Z"
Wed 9 Sep 2015 13:19:09 NZST
$ date -j -f "%FT%TZ" "2015-09-09T13:19:09Z" +%s
1441761549
Looks fine except it's wrong answer. It's exactly 12 hours behind real answer and my timezone +12 so how cloud timezone influence unix epoch ?
And just verifying myself
$ docker run -it --rm trusty date -d"2015-09-09T13:19:09Z" +%s
1441804749
same tools on linux giving correct answer ...
I just want to understand what is wrong here - am i missing something or is it just a broken thing ?
OSX Yosemite 10.10.4
UPD:
Just some extra details - i'd suggest it's a difference between date
util, except it's not only date
.
Stass-MacBook:~ void$ python -c 'import dateutil.parser; print dateutil.parser.parse("2015-09-09T13:19:09Z").strftime("%s")'
1441761549
Stass-MacBook:~ void$ docker run trusty python -c 'import dateutil.parser; print dateutil.parser.parse("2015-09-09T13:19:09Z").strftime("%s")'
1441804749