as_jdate {shide}R Documentation

Cast an object to a jdate object

Description

A generic function that converts other date/time classes to jdate.

Usage

as_jdate(x, ...)

Arguments

x

A vector of jdatetime, POSIXct or Date.

...

These dots are for future extensions and must be empty.

Details

Unlike R's as.Date.POSIXct() method, as_jdate does not expose a time zone argument and uses time zone attribute of input datetime object for conversion.

Value

A vector of jdate objects with the same length as x.

Examples

as_jdate(as.Date("2023-12-12"))
as_jdate(jdatetime("1402-09-21 13:14:00", tzone = "Asia/Tehran"))
as_jdate(as.POSIXct("2023-12-12 13:14:00", tz = "Asia/Tehran"))

[Package shide version 0.2.1 Index]