Learn R Programming

ds4psy (version 0.2.1)

cur_date: Current date (in yyyy-mm-dd or dd-mm-yyyy format).

Description

cur_date provides a relaxed version of Sys.time() that is sufficient for most purposes.

Usage

cur_date(rev = FALSE, sep = "-")

Arguments

rev

Boolean: Reverse from "yyyy-mm-dd" to "dd-mm-yyyy" format? Default: rev = FALSE.

sep

Character: Separator to use. Default: sep = "-".

Details

cur_date returns Sys.time() (in " using current system settings.

By default, this corresponds to the " format used as the ISO 8601 standard.

For more options, see the date() and Sys.Date() functions of base R and the plethora of formatting options for Sys.time().

See Also

date() and today() functions of the lubridate package; date(), Sys.Date(), and Sys.time() functions of base R.

Other date and time functions: cur_time(), what_date(), what_day(), what_month(), what_time(), what_week(), what_year()

Examples

Run this code
# NOT RUN {
cur_date()
cur_date(sep = "/")
cur_date(rev = TRUE)
cur_date(rev = TRUE, sep = ".")

# }

Run the code above in your browser using DataLab