File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
core/commonMain/src/kotlinx/serialization/builtins Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -247,15 +247,20 @@ public fun UShort.Companion.serializer(): KSerializer<UShort> = UShortSerializer
247
247
248
248
/* *
249
249
* Returns serializer for [Duration].
250
- * It is serialized as a string that represents a duration in the ISO-8601-2 format.
250
+ * It is serialized as a string that represents a duration in the format used by [Duration.toIsoString],
251
+ * that is, the ISO-8601-2 format.
251
252
*
252
- * The result of serialization is similar to calling [Duration.toIsoString], for deserialization is [Duration.parseIsoString].
253
+ * For deserialization, [Duration.parseIsoString] is used.
254
+ *
255
+ * @see Duration.toIsoString
256
+ * @see Duration.parseIsoString
253
257
*/
254
258
public fun Duration.Companion.serializer (): KSerializer <Duration > = DurationSerializer
255
259
256
260
/* *
257
261
* Returns serializer for [Instant].
258
- * It is serialized as a string that represents an instant in the format described in ISO-8601-1:2019, 5.4.2.1b).
262
+ * It is serialized as a string that represents an instant in the format used by [Instant.toString]
263
+ * and described in ISO-8601-1:2019, 5.4.2.1b).
259
264
*
260
265
* Deserialization is case-insensitive.
261
266
* More details can be found in the documentation of [Instant.toString] and [Instant.parse] functions.
Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ import kotlinx.serialization.encoding.*
10
10
import kotlin.time.ExperimentalTime
11
11
import kotlin.time.Instant
12
12
13
+ /* *
14
+ * Serializer that encodes and decodes [Instant] as its second and nanosecond components of the Unix time.
15
+ *
16
+ * JSON example: `{"epochSeconds":1607505416,"nanosecondsOfSecond":124000}`.
17
+ */
13
18
@ExperimentalTime
14
19
public object InstantComponentSerializer : KSerializer<Instant> {
15
20
You can’t perform that action at this time.
0 commit comments