Why does this go back a day? I just want to do dat...
# kotlinx-datetime
s
Why does this go back a day? I just want to do date math (add days) on it:
LocalDateTime(myLocalDate, 0,0,0).toInstant(TimeZone.of("Asia/Gaza"))
- but
LocalDateTime(date, 1,0,0)
is on the correct day.
c
Asia/Gaza is UTC+3. That means it is 3 hours more than UTC. 00:00 Jan 1st Asia/Gaza local time is therefore 21:00 Dec 31st UTC
s
Oh! Thank you!!
i
Note that if you want to add days to a LocalDate, you can use arithmetic functions on LocalDate, such as
plus
👍 1