getters | R Documentation |
Getter methods for datetimeoffset()
objects.
## S3 method for class 'datetimeoffset'
get_year(x)
## S3 method for class 'datetimeoffset'
get_month(x)
## S3 method for class 'datetimeoffset'
get_day(x)
## S3 method for class 'datetimeoffset'
get_hour(x)
## S3 method for class 'datetimeoffset'
get_minute(x)
## S3 method for class 'datetimeoffset'
get_second(x)
## S3 method for class 'datetimeoffset'
get_nanosecond(x)
get_subsecond_digits(x)
## S3 method for class 'datetimeoffset'
get_subsecond_digits(x)
## Default S3 method:
get_subsecond_digits(x)
get_hour_offset(x)
## S3 method for class 'datetimeoffset'
get_hour_offset(x)
## Default S3 method:
get_hour_offset(x)
## S3 method for class 'POSIXt'
get_hour_offset(x)
get_minute_offset(x)
## S3 method for class 'datetimeoffset'
get_minute_offset(x)
## Default S3 method:
get_minute_offset(x)
## S3 method for class 'POSIXt'
get_minute_offset(x)
get_tz(x)
## S3 method for class 'datetimeoffset'
get_tz(x)
## S3 method for class 'Date'
get_tz(x)
## S3 method for class 'POSIXt'
get_tz(x)
## S3 method for class 'clock_zoned_time'
get_tz(x)
## Default S3 method:
get_tz(x)
x |
A datetime object. |
We implement datetimeoffset()
support for the following S3 methods from clock
:
get_year()
get_month()
get_day()
get_hour()
get_minute()
get_second()
get_nanosecond()
We also implemented new S3 getter methods:
get_subsecond_digits()
get_hour_offset()
get_minute_offset()
get_tz()
We also implement datetimeoffset()
support for the following S3 methods from lubridate
:
year()
month()
mday()
hour()
minute()
second()
tz()
date()
The component
library("clock")
if ("Europe/Paris" %in% OlsonNames()) {
dt <- as_datetimeoffset("1918-11-11T11:11:11.1234+00:00[Europe/Paris]")
} else {
dt <- as_datetimeoffset("1918-11-11T11:11:11.1234")
}
get_year(dt)
get_month(dt)
get_day(dt)
get_hour(dt)
get_minute(dt)
get_second(dt)
get_nanosecond(dt)
get_subsecond_digits(dt)
get_hour_offset(dt)
get_minute_offset(dt)
get_tz(dt)
if (require("lubridate")) {
paste0(year(dt), "-", month(dt), "-", day(dt),
"T", hour(dt), ":", minute(dt), ":", second(dt),
"[", tz(dt), "]")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.