Skip to content

Commit b555398

Browse files
authored
Clarify the docs for LocalTime.atStartOfDay (#284)
Fixes #282
1 parent c757dbf commit b555398

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/common/src/TimeZone.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,10 @@ public expect fun LocalDateTime.toInstant(offset: UtcOffset): Instant
174174
*
175175
* Note that it's not equivalent to `atTime(0, 0).toInstant(timeZone)`
176176
* because a day does not always start at the fixed time 0:00:00.
177+
* For example, if due do daylight saving time, clocks were shifted from 23:30
178+
* of one day directly to 00:30 of the next day, skipping the midnight, then
179+
* `atStartOfDayIn` would return the `Instant` corresponding to 00:30, whereas
180+
* `atTime(0, 0).toInstant(timeZone)` would return the `Instant` corresponding
181+
* to 01:00.
177182
*/
178183
public expect fun LocalDate.atStartOfDayIn(timeZone: TimeZone): Instant

0 commit comments

Comments
 (0)