| clock | R Documentation |
Clock class
clock(...)
... |
date parts, must be supplied in order (i.e., if you want to give
seconds, you must give all others first): year, month, day, hour, minutes,
seconds. uses |
Methods These must be called with parens
now(tzone = "")Get the date time right now
param tzone: a valid time zone
date()Same as $now() but as a Date class
utc()Same as $now() but with time zone set to UTC
Active Methods These are called without parens
timeGet the current time or the time you set on initialize
yearGet the year component of the time
monthGet the month component of the time
dayGet the day component of the time
hourGet the hour component of the time
minGet the minute component of the time
secGet the seconds component of the time
utc_offsetGet the utc offset
unix_epochGet the time in seconds since unix epoch
a POSIXct object
# if no time set when initialized
## uses current time when you call functions with parens
x <- clock(2009)
x
## and uses current time when you call active functions
x$utc
x$date
x$year
x$month
# if time set when initialized
## ignores that time when calling functions with parens
z <- clock(2009, 3, 13)
z
z$utc
## and uses the user set time when you call active functions
z$year
z$month
z$utc_offset
z$unix_epoch
#
clock(2009)$time
clock(2009, 3, 13)$time
clock(2009, 3, 13, 1, 4, 53)$time
now()
now("UTC")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.