
R version 4.0.4 (2021-02-15) -- "Lost Library Book"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> ## set Z's timezone for reproducibility
> Sys.setenv(TZ = "Europe/Vienna")
> 
> ## base results
> as.Date(10957, origin = "1970-01-01")
[1] "2000-01-01"
> as.Date("2000-01-01")
[1] "2000-01-01"
> as.Date(as.POSIXct("2000-01-01 00:00:00 GMT", tz = "GMT"))
[1] "2000-01-01"
> as.Date(as.POSIXlt("2000-01-01 00:00:00 GMT", tz = "GMT"))
[1] "2000-01-01"
> as.Date(NA)
[1] NA
> 
> ## for chron objects
> library("chron")
> as.Date(dates("01/01/2000"))
[1] "2000-01-01"
> as.Date(chron("01/01/2000", "00:00:00"))
[1] "2000-01-01"
> 
> ## for tis objects
> library("tis")
> as.Date(ti(20000101, "daily"))
[1] "2000-01-01"
> as.Date(jul(20000101))
[1] "2000-01-01"
> 
> ## for timeDate objects
> library("timeDate")

Attaching package: 'timeDate'

The following objects are masked from 'package:tis':

    dayOfWeek, dayOfYear, isHoliday

> as.Date(timeDate("2000-01-01"))
[1] "2000-01-01"
> 
> ## with zoo attached (masking as.Date/as.Date.numeric)
> library("zoo")

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

> as.Date(10957)
[1] "2000-01-01"
> as.Date("2000-01-01")
[1] "2000-01-01"
> as.Date(as.POSIXct("2000-01-01 00:00:00 GMT", tz = "GMT"))
[1] "2000-01-01"
> as.Date(as.POSIXlt("2000-01-01 00:00:00 GMT", tz = "GMT"))
[1] "2000-01-01"
> as.Date(NA)
[1] NA
> as.Date(yearmon(2000))
[1] "2000-01-01"
> as.Date(yearqtr(2000))
[1] "2000-01-01"
> as.Date(dates("01/01/2000"))
[1] "2000-01-01"
> as.Date(chron("01/01/2000", "00:00:00"))
[1] "2000-01-01"
> as.Date.ti <- tis:::as.Date.ti                  ## filed request for export
> as.Date(ti(20000101, "daily"))
[1] "2000-01-01"
> as.Date.jul <- tis:::as.Date.jul                ## filed request for export
> as.Date(jul(20000101))
[1] "2000-01-01"
> as.Date.timeDate <- timeDate:::as.Date.timeDate ## filed request for export
> as.Date(timeDate("2000-01-01"))
[1] "2000-01-01"
> 
> ## with mondate attached (masking again as.Date)
> library("mondate")

Attaching package: 'mondate'

The following objects are masked from 'package:tis':

    day, month, quarter, year, ymd

The following object is masked from 'package:base':

    as.difftime

> as.Date(10957)
[1] "2000-01-01"
> as.Date("2000-01-01")
[1] "2000-01-01"
> as.Date(as.POSIXct("2000-01-01 00:00:00 GMT", tz = "GMT"))
[1] "2000-01-01"
> as.Date(as.POSIXlt("2000-01-01 00:00:00 GMT", tz = "GMT"))
[1] "2000-01-01"
> as.Date(NA)
[1] NA
> as.Date(yearmon(2000))
[1] "2000-01-01"
> as.Date(yearqtr(2000))
[1] "2000-01-01"
> as.Date(dates("01/01/2000"))
[1] "2000-01-01"
> as.Date(chron("01/01/2000", "00:00:00"))
[1] "2000-01-01"
> as.Date(ti(20000101, "daily"))
[1] "2000-01-01"
> as.Date(jul(20000101))
[1] "2000-01-01"
> as.Date(timeDate("2000-01-01"))
[1] "2000-01-01"
> as.Date(mondate(1/31))
[1] "2000-01-01"
> 
> 
> proc.time()
   user  system elapsed 
  0.491   0.028   0.512 
