JavaScript Date instances don't seem to represent localdate
See original GitHub issueIn browsers new Date("2021-12-18T22:23")
seem to produce a local date time.
So when calling new Date("2021-12-18T22:23").toISOString()
on my local machine (situated in Timezone Europe/Berlin) the resulting string will be 2021-12-18T21:23:00.000Z
The browser implementation seems to calculate the UTC time from the Date instance.
But when running this in HTMLUnit I wasn’t able to get the correct UTC string. Even when setting the Timezone on the browser version.
I changed my example project https://github.com/thuri/htmlunit-jquery-selector-init that was created for #422 and added a new Test DateStringConversionTest.java
and an new example html dateStringConversionTest.html
where this behavior can be reproduced.
Probably i’m just missing some configuration here but I couldn’t find something on the web
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
made a PR for Rhino https://github.com/mozilla/rhino/pull/1132
This is fixed with the 2.58.0 release. Thanks for this report.