current-date-time: Current Date and Time

current-date-timeR Documentation

Current Date and Time

Description

today returns the current date and now returns the current date and time (in the system time zone or the time zone provided by the user).

Usage

today(tz = NULL)

now(tz = NULL, digits = 0)

Arguments

tz

(optional) a character value determining the time zone (the default NULL is interpreted as the system time zone). See tzone documentation for information on time zones.

digits

an integer value giving the number of decimal places for seconds (0–6, 0 by default).

Value

today and now return an object of class tind of length 1 and type "d" (date) and "t" (date-time), respectively.

Examples

today()
now()
# millisecond accuracy
now(digits = 3)
# check current date and time in different time zones
if ("Asia/Tokyo" %in% OlsonNames()) {
now("Asia/Tokyo")
today("Asia/Tokyo")
}
if ("Europe/Warsaw" %in% OlsonNames()) {
now("Europe/Warsaw")
today("Europe/Warsaw")
}
if ("America/New_York" %in% OlsonNames()) {
now("America/New_York")
today("America/New_York")
}


tind documentation built on Dec. 28, 2025, 1:06 a.m.