startOfDay returning incorrect value?
webfrea-k opened this issue · comments
I live in a UTC + 2 timezone.
When calling DateTime.now().startOfDay
I get:
Fri, 24 Jul 2020 00:00:00 UTC
Shouldn't the call to DateTime.now().startOfDay.local
return:
Thu, 23 Jul 2020 22:00:00 GMT+0200?
It currently returns:
Fri, 24 Jul 2020 02:00:00 GMT+0200
I think it shouldn't return 2200. When you have midnight at UTC, you have 2am at GMT+2 (the night just comes earlier to GMT+2 because it's closer to the east
I've also checked this at https://www.thetimezoneconverter.com/:
Finally, this is not related to startOfDay
, for me even strict dates work the same way:
val a = DateTime(2021, 4, 14)
val b = a.local
println(a) // Wed, 14 Apr 2021 00:00:00 UTC
println(b) // Wed, 14 Apr 2021 03:00:00 GMT+0300
So I guess this issue can be closed.