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
I was just wondering if there's a technical reason why Instant has toEpochMilli() but ZonedDateTime does not?
If there's no technical reason would you be open to a PR to add toEpochMilli() in addition to toEpochSecond()?
Rationale: I primarily use ZonedDateTime's and there's about a thousand places in my code base where I have to zdt.toEpochSecond() * 1e3 (which isn't that pretty and kind of fragile) or zdt.toInstant().toEpochMilli() which has a lot of unnecessary CPU cycles converting to Instant.
These calcs run millions of times per second so CPU cycles are kind of important (similar to perf impact I had from #734)
The text was updated successfully, but these errors were encountered:
Hi,
I was just wondering if there's a technical reason why Instant has
toEpochMilli()
but ZonedDateTime does not?If there's no technical reason would you be open to a PR to add
toEpochMilli()
in addition totoEpochSecond()
?Rationale: I primarily use ZonedDateTime's and there's about a thousand places in my code base where I have to
zdt.toEpochSecond() * 1e3
(which isn't that pretty and kind of fragile) orzdt.toInstant().toEpochMilli()
which has a lot of unnecessary CPU cycles converting to Instant.These calcs run millions of times per second so CPU cycles are kind of important (similar to perf impact I had from #734)
The text was updated successfully, but these errors were encountered: