View source: R/pretty_timestamp.R
pretty_timestamp | R Documentation |
Function to quickly get a pretty timestamp without need to handle format-options etc.
pretty_timestamp(timestamp, no_spaces = FALSE)
timestamp |
A POSIXct timestamp or a string which ca be converted to a POSIXct timestamp. |
no_spaces |
Boolean. Default = 'FALSE'. Specifies whether the output can contain spaces or not. E.g. if the output is for human reading, 'no_spaces = FALSE' is a good option. As suffix for file names (e.g. logfiles), 'no_spaces = TRUE' might be a good option. |
The timestamp in always the same format. #'
pretty_timestamp("2023-10-30 12:34:56", no_spaces = TRUE)
# Result: "2023-10-30T123456"
pretty_timestamp("2023-10-30 12:34:56")
# this is the same like
pretty_timestamp("2023-10-30 12:34:56", no_spaces = FALSE)
# Result: "30. Oct 2023 - 12:34 UTC"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.