POSIXlt time objects¶
t0 <- as.POSIXlt(0,origin="2020-02-01",tz="GMT")
(t1 <- as.POSIXlt(t0 + 3630))
[1] "2020-02-01 01:00:30 GMT"
# Get the seconds component of the time point
t1$sec
[1] 30
# Get the minutes component of the time point
t1$min
[1] 0
# Get the hours component
t1$hour
[1] 1
# Get the day(s) of the month
t1$mday
[1] 1
# Get the (numeric) month
t1$mon
[1] 1
# Get the (numeric) year
t1$year
[1] 120
# Get the (numeric) day of the week
t1$wday
[1] 6
- R file: POSIXlt-time-objects.R
- Rmarkdown file: POSIXlt-time-objects.Rmd
- Jupyter notebook file: POSIXlt-time-objects.ipynb
- Interactive version of the Jupyter notebook (shuts down after 60s):
- Interactive version of the Jupyter notebook (sign in required):