When parsing a string in a javascript Date object, if you don’t set a time, the string is taken in as UTC. Then when retrieving it, it displays as local time.
new Date('2020-01-01');
will return “Tue Dec 31 2019 14:00:00 GMT-1000 (Hawaii-Aleutian Standard Time) {}” when the current time is after 10am HST.
However,
new Date('2020-01-01 00:00:00');
will return “Wed Jan 01 2020 00:00:00 GMT-1000 (Hawaii-Aleutian Standard Time) {}” anytime, even after 10am HST.
Obviously, this is due to timezones. This stack overflow gets into the nitty gritty details:
https://stackoverflow.com/questions/5619202/converting-a-string-to-a-date-in-javascript