You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Change java.util.Date to java.time.LocalDateTime in Clock API #1686
Thanks for the suggestion. We prototyped it (#1937) but decided not to expand the Clock API for this.
LocalDateTime has no time zone, so it's a poor fit for an absolute clock time — it'd force a hidden systemDefault() conversion. And the workaround is a one-liner today: page.clock().setSystemTime(Date.from(localDateTime.toInstant(ZoneOffset.UTC))).
Activity
jhyot commentedon Nov 28, 2024
Definitely 100% support for this. Please don't use the very old and broken
DateAPI, modern code should always use thejava.timeAPI.feat(clock): add java.time.Instant overloads to the Clock API
yury-s commentedon Jun 19, 2026
Thanks for the suggestion. We prototyped it (#1937) but decided not to expand the Clock API for this.
LocalDateTimehas no time zone, so it's a poor fit for an absolute clock time — it'd force a hiddensystemDefault()conversion. And the workaround is a one-liner today:page.clock().setSystemTime(Date.from(localDateTime.toInstant(ZoneOffset.UTC))).Closing as not planned.