Kien
4 years agoNew Contributor
Compare DateTime against a point in time (in local time zone)
Hi, I’m having a hard time trying to figure out a way to compare a DateTime property (which is stored in UTC) to a point in time i.e. Today midnight (in the current local time zone which is US/Eastern -05:00)…
The closest thing came to find is Date.parse(Date.now().toLocaleDateString()+"T00:00:00.000-05:00")
which in turns gives me “2022-01-12T05:00:00.000 UTC”… but I don’t want to hard code the “-05:00” portion as during DST it would be -04:00…
Any ideas? Thanks!