cur_time | R Documentation |
cur_time
provides a satisficing version of
Sys.time()
that is sufficient for most purposes.
cur_time(seconds = FALSE, as_string = TRUE, sep = ":")
seconds |
Boolean: Show time with seconds?
Default: |
as_string |
Boolean: Return as character string?
Default: |
sep |
Character: Separator to use.
Default: |
By default, cur_time
returns a
Sys.time()
as a character string
(in "
using current system settings.
If as_string = FALSE
, a "POSIXct"
(calendar time) object is returned.
For a time zone argument,
see the what_time
function,
or the now()
function of
the lubridate package.
A character string or object of class "POSIXct".
what_time()
function to print times with more options;
now()
function of the lubridate package;
Sys.time()
function of base R.
Other date and time functions:
change_time()
,
change_tz()
,
cur_date()
,
days_in_month()
,
diff_dates()
,
diff_times()
,
diff_tz()
,
is_leap_year()
,
what_date()
,
what_month()
,
what_time()
,
what_wday()
,
what_week()
,
what_year()
,
zodiac()
cur_time()
cur_time(seconds = TRUE)
cur_time(sep = ".")
# return a "POSIXct" object:
t <- cur_time(as_string = FALSE)
format(t, "%T %Z")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.