what_time
provides a satisficing version of
Sys.time()
that is sufficient for most purposes.
what_time(when = NA, seconds = FALSE, sep = ":")
Time (as a scalar or vector).
Default: when = NA
.
Returning Sys.time()
, if when = NA
.
Boolean: Show time with seconds?
Default: seconds = FALSE
.
Character: Separator to use.
Default: sep = ":"
.
what_time
returns either a simple version of
when
or Sys.time()
(in "
using current system settings.
cur_time()
function to print the current time;
cur_date()
function to print the current date;
now()
function of the lubridate package;
Sys.time()
function of base R.
Other date and time functions:
cur_date()
,
cur_time()
,
what_date()
,
what_day()
,
what_month()
,
what_week()
,
what_year()
# NOT RUN {
what_time()
# with vector (of times):
ts <- c("2020-01-14 01:02:03 CET", "2020-12-31 14:15:16")
what_time(ts)
what_time(ts, seconds = TRUE, sep = "_")
# }
Run the code above in your browser using DataLab