Description Usage Arguments Value Examples
Encodes a timestamp to the 'MsgPack' specifications.
1 2 3 | msgpack_timestamp_encode(posix = NULL, seconds = NULL, nanoseconds = NULL)
msgpackTimestampEncode(posix = NULL, seconds = NULL, nanoseconds = NULL)
|
posix |
A POSIXct or POSIXlt or anything that can be coerced to a numeric. |
seconds |
The number of seconds since 1970-01-01 00:00:00 UTC. Can be negative. Don't use seconds and nanoseconds if you use posix (and vice versa). |
nanoseconds |
The number of nanoseconds since 1970-01-01 00:00:00 UTC. Must be less than 1,000,000,000 and greater than 0. |
A serialized timestamp that can be used as input to msgpack_pack. Briefly, this is an extension type -1 that is variable length, depending on the desired range and precision.
1 2 3 4 5 | mt <- Sys.time()
attr(mt, "tzone") <- "UTC"
mp <- msgpack_pack(msgpack_timestamp_encode(mt))
mtu <- msgpack_timestamp_decode(msgpack_unpack(mp))
identical(mt, mtu)
|
[1] TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.