@@ -38,16 +38,16 @@ import kotlin.time.*
38
38
* The [Clock.System] implementation uses the platform-specific system clock to obtain the current moment.
39
39
* Note that this clock is not guaranteed to be monotonic, and it may be adjusted by the user or the system at any time,
40
40
* so it should not be used for measuring time intervals.
41
- * For measuring time intervals , consider [TimeSource.Monotonic].
41
+ * For that , consider [TimeSource.Monotonic].
42
42
*
43
43
* ### Obtaining human-readable representations
44
44
*
45
45
* #### Date and time
46
46
*
47
- * [Instant] is essentially the number of seconds and nanoseconds since a deesignated moment in time,
47
+ * [Instant] is essentially the number of seconds and nanoseconds since a designated moment in time,
48
48
* stored as something like `1709898983.123456789`.
49
49
* [Instant] contains no information about what day or time it is, as this depends on the time zone.
50
- * To obtain this information for a specific time zone, obtain a [LocalDateTime] using [Instant.toLocalDateTime]:
50
+ * To work with this information for a specific time zone, obtain a [LocalDateTime] using [Instant.toLocalDateTime]:
51
51
*
52
52
* ```
53
53
* val instant = Instant.fromEpochSeconds(1709898983, 123456789)
@@ -57,11 +57,11 @@ import kotlin.time.*
57
57
*
58
58
* For values very far in the past or the future, this conversion may fail.
59
59
* The specific range of values that can be converted to [LocalDateTime] is platform-specific, but at least
60
- * [DISTANT_PAST], [DISTANT_FUTURE], and all values between them can be converted to [LocalDateTime] without exceptions .
60
+ * [DISTANT_PAST], [DISTANT_FUTURE], and all values between them can be converted to [LocalDateTime].
61
61
*
62
62
* #### Date or time separately
63
63
*
64
- * To obtain a [LocalDate] or [LocalTime], first, obtain a [LocalDateTime] and then use its [LocalDateTime.date]
64
+ * To obtain a [LocalDate] or [LocalTime], first, obtain a [LocalDateTime], and then use its [LocalDateTime.date]
65
65
* and [LocalDateTime.time] properties:
66
66
*
67
67
* ```
@@ -73,7 +73,7 @@ import kotlin.time.*
73
73
*
74
74
* #### Elapsed-time-based
75
75
*
76
- * The [plus] and [minus] operators can be used to add and subtract [Duration]s from an [Instant]:
76
+ * The [plus] and [minus] operators can be used to add [Duration]s to and subtract them from an [Instant]:
77
77
*
78
78
* ```
79
79
* Clock.System.now() + Duration.seconds(5) // 5 seconds from now
@@ -85,7 +85,7 @@ import kotlin.time.*
85
85
* Clock.System.now().plus(4, DateTimeUnit.HOUR) // 4 hours from now
86
86
* ```
87
87
*
88
- * Also, there is a [minus] operator that returns a [Duration] representing the difference between two instants:
88
+ * Also, there is a [minus] operator that returns the [Duration] representing the difference between two instants:
89
89
*
90
90
* ```
91
91
* val start = Clock.System.now()
@@ -137,7 +137,7 @@ import kotlin.time.*
137
137
* [toEpochMilliseconds] can be used to obtain the number of milliseconds since the epoch.
138
138
* Note that [Instant] supports nanosecond precision, so converting to milliseconds is a lossy operation.
139
139
*
140
- * [parse] and [toString] methods can be used to obtain a [Instant] from and convert it to a string in the
140
+ * [parse] and [toString] methods can be used to obtain an [Instant] from and convert it to a string in the
141
141
* ISO 8601 extended format (for example, `2023-01-02T22:35:01+01:00`).
142
142
* During parsing, the UTC offset is not returned separately.
143
143
* If the UTC offset is important, use [DateTimeComponents] with [DateTimeComponents.Formats.ISO_DATE_TIME_OFFSET] to
@@ -210,8 +210,7 @@ public expect class Instant : Comparable<Instant> {
210
210
* **Pitfall**: do not use [Duration] values obtained via [Duration.Companion.days], as this is misleading:
211
211
* in `kotlinx-datetime`, adding a day is a calendar-based operation, whereas [Duration] always considers
212
212
* a day to be 24 hours.
213
- * For an explanation of why this is error-prone, see the section about arithmetic operations in the [LocalDateTime]
214
- * documentation.
213
+ * For an explanation of why this is error-prone, see [DateTimeUnit.DayBased].
215
214
*/
216
215
public operator fun minus (duration : Duration ): Instant
217
216
0 commit comments