date.format
date.format copied to clipboard
format("z") seems to have issues with timezones
In Chrome's console:
new Date(1534545439635);
Sat Aug 18 2018 00:37:19 GMT+0200 (Central European Summer Time)
new Date(1534545439635).format("z");
"229"
The same day but later:
new Date(1534588427903)
Sat Aug 18 2018 12:33:47 GMT+0200 (Central European Summer Time)
new Date(1534588427903).format("z");
"230"
The timestamp at 00:37:19 returns "229" but the timestamp of the same day at 12:33:47 returns "230"
Note: Central European Summer Time is GMT +02:00 ;)
After a quick google I think I found a solution that seems to work on SO: https://stackoverflow.com/a/26426761/781094
I've hacked it in your dateformat library and the results are promising ;)