jdate_make {shide}R Documentation

Construct Jalali date-time objects from individual components

Description

Usage

jdate_make(year, month = 1L, day = 1L, ...)

jdatetime_make(
  year,
  month = 1L,
  day = 1L,
  hour = 0L,
  minute = 0L,
  second = 0L,
  tzone = "",
  ...,
  ambiguous = NULL
)

Arguments

year

Numeric year.

month

Numeric month.

day

Numeric day.

...

These dots are for future extensions and must be empty.

hour

Numeric hour.

minute

Numeric minute.

second

Numeric second.

tzone

A time zone name. Default value represents local time zone.

ambiguous

Resolve ambiguous times that occur during a repeated interval (when the clock is adjusted backwards during the transition from DST to standard time). Possible values are:

  • "earliest": Choose the earliest of the two moments.

  • "latest": Choose the latest of the two moments.

  • "NA": Produce NA.

If NULL, defaults to "earliest"; as this seems to be base R's behavior.

Details

Numeric components are recycled to their common size using tidyverse recycling rules.

Value

Examples

## At least 'year' must be supplied
jdate_make(year = 1401)
## Components are recycled
jdatetime_make(year = 1399:1400, month = 12, day = c(30, 29), hour = 12, tzone = "UTC")
## resolve ambiguous time by choosing the later time instant
jdatetime_make(1401, 6, 30, 23, 0, 0, tzone = "Asia/Tehran", ambiguous = "latest")

[Package shide version 0.2.1 Index]