Hello there! Probably stupid question, but search ...
# kotlinx-datetime
k
Hello there! Probably stupid question, but search doesn’t give me an answer unfortunately. Is there a simple way to clamp
LocalDateTime
to the beginning of the day? So far I see only the option
localDateTime.date.atTime(0, 0)
, is this the way? mandalorian
i
Sometimes, when the day begins depend on the time zone. If you want to take that into account, you can follow this path:
localDateTime.date.atStartOfDayIn(tz).toLocalDateTime(tz)
1
k
Thanks!