I would have expected calling zoned-date-time with a timezone to use java-time.clock/*clock* instead of the system clock. Inspecting the code it looks like the single-arg-zone case for zoned-date-time is just calling (java.time.ZonedDateTime/now zone) which uses the system clock according to the documentation.
There's a similar issue with offset-date-time and offset-time and maybe others, I didn't inspect everything.
If I establish a clock with
with-clock
and callzoned-date-time
with zero args I get the value from the clock:However, if I specify only a timezone, it uses the system clock:
I can work around this by constructing a
zoned-date-time
with zero args and passing that tozoned-date-time
with a zone:I would have expected calling
zoned-date-time
with a timezone to usejava-time.clock/*clock*
instead of the system clock. Inspecting the code it looks like the single-arg-zone case forzoned-date-time
is just calling(java.time.ZonedDateTime/now zone)
which uses the system clock according to the documentation.There's a similar issue with
offset-date-time
andoffset-time
and maybe others, I didn't inspect everything.