I have some unit tests failing with errors like:
- "dateModified": "Fri Mar 06 2015 00:00:00 GMT+0000 (UTC)"
- "datePublished": "Fri Mar 06 2015 00:00:00 GMT+0000 (UTC)"
+ "dateModified": "Fri Mar 06 2015 00:00:00 GMT+0000 (GMT Standard Time)"
+ "datePublished": "Fri Mar 06 2015 00:00:00 GMT+0000 (GMT Standard Time)"
One set of results in from node 6.5.0 on Unix, the other node 6.5.0 on Windows.
This is odd, as I was under the impression that UTC was GMT.
- Is UTC the same thing as GMT?
- If not, what is the difference?
- Is one preferable to the other?
Some further tests setting the TZ
environment variable:
Before changing the timezone:
$ node
> new Date().toString()
'Fri Sep 02 2016 17:14:36 GMT+0100 (GMT Daylight Time)'
After changing the timezone:
$ $env:TZ='UTC'
$ node
> new Date().toString()
'Fri Sep 02 2016 16:15:34 GMT+0000 (GMT Standard Time)'