anmolitor / elm-protoc-utils / Protobuf.Utils.Timestamp

Conversions between the Protobuf Well-Known Type "Timestamp" and Elm's Time.Posix.

posixToTimestamp : Time.Posix -> Timestamp

Convert a posix millisecond timestamp into the protobuf seconds/nanos representation

timestampToPosix : Timestamp -> Time.Posix

Convert the protobuf seconds/nanos representation into a posix millisecond timestamp

timestampJsonEncoder : Timestamp -> Json.Encode.Value

Custom JSON encoder for timestamps as ISO-8601 date strings

timestampJsonDecoder : Json.Decode.Decoder Timestamp

Custom JSON decoder for timestamps as ISO-8601 date strings