@@ -15,12 +15,12 @@ import kotlin.time.*
15
15
/* *
16
16
* A moment in time.
17
17
*
18
- * A point in time must be uniquely identified, so that it is independent of a time zone.
19
- * For example, `1970-01-01, 00:00:00` does not represent a moment in time, since this would happen at different times
20
- * in different time zones: someone in Tokyo would think its already `1970-01-01` several hours earlier than someone in
18
+ * A point in time must be uniquely identified so that it is independent of a time zone.
19
+ * For example, `1970-01-01, 00:00:00` does not represent a moment in time since this would happen at different times
20
+ * in different time zones: someone in Tokyo would think it is already `1970-01-01` several hours earlier than someone in
21
21
* Berlin would. To represent such entities, use [LocalDateTime].
22
22
* In contrast, "the moment the clocks in London first showed 00:00 on Jan 1, 2000" is a specific moment
23
- * in time, as is "1970-01-01, 00:00:00 UTC+0", and so it can be represented as an [Instant].
23
+ * in time, as is "1970-01-01, 00:00:00 UTC+0", so it can be represented as an [Instant].
24
24
*
25
25
* `Instant` uses the UTC-SLS (smeared leap second) time scale. This time scale doesn't contain instants
26
26
* corresponding to leap seconds, but instead "smears" positive and negative leap seconds among the last 1000 seconds
@@ -46,7 +46,7 @@ import kotlin.time.*
46
46
*
47
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
- * [Instant] contains no information about what day or time it is , as this depends on the time zone.
49
+ * [Instant] does not contain information about the day or time, as this depends on the time zone.
50
50
* To work with this information for a specific time zone, obtain a [LocalDateTime] using [Instant.toLocalDateTime]:
51
51
*
52
52
* ```
@@ -98,16 +98,16 @@ import kotlin.time.*
98
98
* Since [Instant] represents a point in time, it is always well-defined what the result of arithmetic operations on it
99
99
* is, including the cases when a calendar is used.
100
100
* This is not the case for [LocalDateTime], where the result of arithmetic operations depends on the time zone.
101
- * See the documentation of [LocalDateTime] for more details.
101
+ * See the [LocalDateTime] documentation for more details.
102
102
*
103
103
* Adding and subtracting calendar-based units can be done using the [plus] and [minus] operators,
104
104
* requiring a [TimeZone]:
105
105
*
106
106
* ```
107
- * // one day from now in Berlin
107
+ * // One day from now in Berlin
108
108
* Clock.System.now().plus(1, DateTimeUnit.DAY, TimeZone.of("Europe/Berlin"))
109
109
*
110
- * // a day and two hours short from two months later in Berlin
110
+ * // A day and two hours short from two months later in Berlin
111
111
* Clock.System.now().plus(DateTimePeriod(months = 2, days = -1, hours = -2), TimeZone.of("Europe/Berlin"))
112
112
* ```
113
113
*
@@ -118,7 +118,7 @@ import kotlin.time.*
118
118
* val start = Clock.System.now()
119
119
* val concertStart = LocalDateTime(2023, 1, 1, 20, 0, 0).toInstant(TimeZone.of("Europe/Berlin"))
120
120
* val timeUntilConcert = start.periodUntil(concertStart, TimeZone.of("Europe/Berlin"))
121
- * // two months, three days, four hours, and five minutes until the concert
121
+ * // Two months, three days, four hours, and five minutes until the concert
122
122
* ```
123
123
*
124
124
* or [Instant.until] method, as well as [Instant.daysUntil], [Instant.monthsUntil],
@@ -187,7 +187,7 @@ import kotlin.time.*
187
187
* ```
188
188
*
189
189
* Additionally, there are several `kotlinx-serialization` serializers for [Instant]:
190
- * - [InstantIso8601Serializer] for the ISO 8601 extended format,
190
+ * - [InstantIso8601Serializer] for the ISO 8601 extended format.
191
191
* - [InstantComponentSerializer] for an object with components.
192
192
*
193
193
* @see LocalDateTime for a user-visible representation of moments in time in an unspecified time zone.
@@ -285,7 +285,7 @@ public expect class Instant : Comparable<Instant> {
285
285
286
286
/* *
287
287
* Compares `this` instant with the [other] instant.
288
- * Returns zero if this instant represents the same moment as the other (i.e., equal to other),
288
+ * Returns zero if this instant represents the same moment as the other (i.e., when it's equal to other),
289
289
* a negative number if this instant is earlier than the other,
290
290
* and a positive number if this instant is later than the other.
291
291
*
@@ -294,9 +294,9 @@ public expect class Instant : Comparable<Instant> {
294
294
public override operator fun compareTo (other : Instant ): Int
295
295
296
296
/* *
297
- * Converts this instant to the ISO 8601 string representation; for example, `2023-01-02T23:40:57.120Z`
297
+ * Converts this instant to the ISO 8601 string representation, for example, `2023-01-02T23:40:57.120Z`.
298
298
*
299
- * The representation uses the UTC-SLS time scale, instead of UTC.
299
+ * The representation uses the UTC-SLS time scale instead of UTC.
300
300
* In practice, this means that leap second handling will not be readjusted to the UTC.
301
301
* Leap seconds will not be added or skipped, so it is impossible to acquire a string
302
302
* where the component for seconds is 60, and for any day, it's possible to observe 23:59:59.
@@ -480,9 +480,9 @@ public fun Instant.minus(period: DateTimePeriod, timeZone: TimeZone): Instant =
480
480
* The components of [DateTimePeriod] are calculated so that adding it to `this` instant results in the [other] instant.
481
481
*
482
482
* All components of the [DateTimePeriod] returned are:
483
- * - positive or zero if this instant is earlier than the other,
484
- * - negative or zero if this instant is later than the other,
485
- * - exactly zero if this instant is equal to the other.
483
+ * - Positive or zero if this instant is earlier than the other.
484
+ * - Negative or zero if this instant is later than the other.
485
+ * - Exactly zero if this instant is equal to the other.
486
486
*
487
487
* @throws DateTimeArithmeticException if `this` or [other] instant is too large to fit in [LocalDateTime].
488
488
* Or (only on the JVM) if the number of months between the two dates exceeds an Int.
@@ -495,9 +495,9 @@ public expect fun Instant.periodUntil(other: Instant, timeZone: TimeZone): DateT
495
495
* in the specified [timeZone].
496
496
*
497
497
* The value returned is:
498
- * - positive or zero if this instant is earlier than the other,
499
- * - negative or zero if this instant is later than the other,
500
- * - zero if this instant is equal to the other.
498
+ * - Positive or zero if this instant is earlier than the other.
499
+ * - Negative or zero if this instant is later than the other.
500
+ * - Zero if this instant is equal to the other.
501
501
*
502
502
* If the result does not fit in [Long], returns [Long.MAX_VALUE] for a positive result or [Long.MIN_VALUE] for a negative result.
503
503
*
@@ -510,9 +510,9 @@ public expect fun Instant.until(other: Instant, unit: DateTimeUnit, timeZone: Ti
510
510
* Returns the whole number of the specified time [units][unit] between `this` and [other] instants.
511
511
*
512
512
* The value returned is:
513
- * - positive or zero if this instant is earlier than the other,
514
- * - negative or zero if this instant is later than the other,
515
- * - zero if this instant is equal to the other.
513
+ * - Positive or zero if this instant is earlier than the other.
514
+ * - Negative or zero if this instant is later than the other.
515
+ * - Zero if this instant is equal to the other.
516
516
*
517
517
* If the result does not fit in [Long], returns [Long.MAX_VALUE] for a positive result or [Long.MIN_VALUE] for a negative result.
518
518
*
@@ -570,9 +570,9 @@ public fun Instant.yearsUntil(other: Instant, timeZone: TimeZone): Int =
570
570
* The components of [DateTimePeriod] are calculated so that adding it back to the `other` instant results in this instant.
571
571
*
572
572
* All components of the [DateTimePeriod] returned are:
573
- * - negative or zero if this instant is earlier than the other,
574
- * - positive or zero if this instant is later than the other,
575
- * - exactly zero if this instant is equal to the other.
573
+ * - Negative or zero if this instant is earlier than the other.
574
+ * - Positive or zero if this instant is later than the other.
575
+ * - Exactly zero if this instant is equal to the other.
576
576
*
577
577
* @throws DateTimeArithmeticException if `this` or [other] instant is too large to fit in [LocalDateTime].
578
578
* Or (only on the JVM) if the number of months between the two dates exceeds an Int.
0 commit comments