ribesg
05/29/2024, 12:49 PMInstant
? In particular, repeating the timezone twice feels a little weird
Clock.System.todayIn(TimeZone.UTC).atStartOfDayIn(TimeZone.UTC)
ephemient
05/29/2024, 4:09 PMOffsetDateTime.now(Clock.systemUTC()).truncatedTo(ChronoUnit.DAYS).toInstant().toKotlinInstant()
ribesg
05/29/2024, 4:10 PMAwkin
06/02/2024, 10:30 AMAwkin
06/02/2024, 10:35 AMribesg
06/02/2024, 10:55 AMribesg
06/02/2024, 10:57 AMAwkin
06/02/2024, 11:02 AMstore a local date so the timezone doesn't matterA local date in your own time zone, you mean? Shouldn't the code then be
Clock.System.todayIn(TimeZone.currentSystemDefault()).atStartOfDayIn(TimeZone.UTC)
?ribesg
06/02/2024, 11:03 AMAwkin
06/02/2024, 11:04 AM2024-01-04
does not have a time zone, by definition, sure, but the date of the current moment (what you get from Clock.System
) is different for different time zones.ribesg
06/02/2024, 11:07 AMAwkin
06/02/2024, 11:07 AMAwkin
06/02/2024, 11:08 AMribesg
06/02/2024, 11:08 AMAwkin
06/02/2024, 11:09 AMribesg
06/02/2024, 11:09 AMribesg
06/02/2024, 11:10 AMAwkin
06/02/2024, 11:11 AMAwkin
06/02/2024, 11:12 AMribesg
06/02/2024, 11:14 AMribesg
06/02/2024, 11:15 AMAwkin
06/02/2024, 11:16 AMribesg
06/02/2024, 11:19 AMAwkin
06/02/2024, 11:20 AMribesg
06/02/2024, 11:20 AM