Similar as the OP:
In the correct spots, of course, just as I do for many other containers. I verify the date and timezone by exec'ing into the container and using
From earlier this morning, results of
On the server: Thu May 7 09:39:21 EDT 2020
Inside my container: Thu May 7 09:38:21 EDT 2020
On my local machine running browser: Thu May 7 09:38:26 EDT 2020
In Chrome's JS console: Thu May 07 2020 9:41:50 GMT-0400 (Eastern Daylight Time)
The debug window showed the correct time for debug messages. I'm not sure if this comes from the browser or server. Actual message content from the server, as well as node status text (presumably from the server, not the browser) we all off by two hours.
msg.payload['date'] = new Date();
msg.payload['localedate'] = new Date().toLocaleString();
msg.payload['offset'] = new Date().getTimezoneOffset();
msg.payload['iso'] = new Date().toISOString();
msg.payload['tzname'] = Intl.DateTimeFormat().resolvedOptions().timeZone;
Gave me this:
localedate: "5/7/2020, 7:49:03 AM"
That 360 offset is two hours different than the correct offset, and I have no idea where that's coming from, but might explain the two hour difference.
And today I learned about "Etc", but no idea where that's coming from. The container is properly configured for EDT.
Trying schedex with a 10:15 on an 10:16 off gave me:
on: "Thu, 07 May 2020 16:15:00 GMT"
off: "Thu, 07 May 2020 16:16:00 GMT"
So it was really confused.
process.env.TZ fixed everything. It's all perfect now.