now: now

View source: R/Now.R

nowR Documentation

now

Description

now

Usage

now(tzone = "")

Arguments

tzone

(character) a valid time zone, defaults to your local timezone

Examples

x <- now()
x
x$time
x$date
x$utc
x$unix_epoch
x$min
x$sec

# mocking
Sys.Date()
clock_mock()
library(timefuzz)
mock <- time_fuzz$new()
## set to today + 10 days
mock$freeze(Sys.Date() + 10)
z <- now()
z
z$time
z$date
z$utc
z$unix_epoch
z$min
z$sec

ropensci/clock documentation built on Sept. 11, 2022, 11:07 a.m.