formatDatetime | R Documentation |
Format a Datetime vector
formatDatetime(dtv, fmt = "%Y-%m-%dT%H:%M:%E*S%Ez", lcltzstr = "UTC", tgttzstr = "UTC") formatDouble(secv, nanov, fmt = "%Y-%m-%dT%H:%M:%E*S%Ez", tgttzstr = "UTC")
dtv |
A Datetime vector object to be formatted |
fmt |
A string with the format, which is based on |
lcltzstr |
The local timezone object for creation the CCTZ timepoint |
tgttzstr |
The target timezone for the desired format |
secv |
A numeric vector with seconds since the epoch |
nanov |
A numeric vector with nanoseconds since the epoch,
complementing |
An alternative to format.POSIXct
based on the CCTZ library. The
formatDouble
variant uses two vectors for seconds since the epoch
and fractional nanoseconds, respectively, to provide fuller resolution.
A string vector with the requested format of the datetime objects
Windows is now supported via the g++-4.9
compiler, but note
that it provides an incomplete C++11 library. This means we had
to port a time parsing routine, and that string formatting is more
limited. As one example, CCTZ frequently uses "%F %T"
which do
not work on Windows; one has to use "%Y-%m-%d %H:%M:%S"
.
Dirk Eddelbuettel
## Not run: now <- Sys.time() formatDatetime(now) # current (UTC) time, in full precision RFC3339 formatDatetime(now, tgttzstr="America/New_York") # same but in NY formatDatetime(now + 0:4) # vectorised ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.