by paradite · 11y ago · 0 comments
and it did NOT work as expected: http://play.golang.org/p/Xd9oEeSffd
(timezone offset is zero)
It seems counter-intuitive to me that the behavior of time.Parse would depend on a "system location", but apparently it's by design.
2013-02-03 19:54:00 +0000 PST
on some machines, and
2013-02-03 19:54:00 -0800 PST
on others. This is means that the timezone offset IS different and the absolute time IS different. One is 8 hours ahead of another even though the original string is the same.
Because it could potentially cause problems if the execution result varies from geographical locations and user's environment. I for one have no idea if my computer has a locale that includes PST timezone.
It's clear that the execution varies, as Parse(), unlike ParseInLocation() depends on the local environment, and play.golang.org probably uses some UTC locale.