Hi guys, I have a question which is driving me up the walls, how can I get yesterday EOD in a given time zone regardless of where my code is running (ie. JVM time). For example If I have a ZonedDateTime
May 1 2020 5:35:00 PM PST
I want to programatically get
April 30 2020 11:59:59 PM PST
I tried
val currentTimeInTimeZone = ZonedDateTime.now(ZoneId.of(someTimeZone))
val yesterday = ZonedDateTime.of(
LocalDate.now().minusDays(1).atTime(LocalTime.MAX).truncatedTo(ChronoUnit.SECONDS),
ZoneId.of(someTimeZone)
)
But it seems to work on my machine and when I push the code to production it does not return the correct value, any ideas / help would be appreciated