View source: R/parse-datetime.r
A simpler, faster mungebit that takes Postgresql CreatedAt statements in the format of YYYY-MM-DD HH:MM:SS.SSSS and convert them into the choice of...
days since 1970 (default)
the hour of day (0-23, use mode="hod")
the day of week (Mon-Sun, use mode="dow")
the day of month (1-31, use mode="dom")
the day of year (1-365, use mode="doy")
the month of year (1-12 corresponding to Jan-Dec, use mode="moy")
if the output is a holiday (TRUE
or FALSE
, use mode="holiday")
if the output is a weekend (TRUE
or FALSE
, use mode="weekend")
if the output is a business day (TRUE
or FALSE
, use mode="bizday")
1 | datetime_fn(createdat, mode = "since", permissive = FALSE)
|
mode |
gives the desired output format (see above) |
permissive |
logical. If false, will error with an improper type. If true, will just warn. |
date |
contains the date to be formatted |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.