ddmmyyyy2Int: Convert a date to a standard integer

Description Usage Arguments Value Note Examples

View source: R/Date2Int.R

Description

For efficient memory consumption

Usage

1
2
3
4
5

Arguments

x

A character vector, represeting a date in dd/mm/YYYY format (ddmmyyyy2Int) or YYYY-mm-dd format (yyyymmdd2Int), or a date time (for yyyymmdd_HHMMSS_UTC).

Value

An integer, equivalent to as.integer(as.Date(x, format)) for the format matching dd/mm/YYYY.

For yyyymmdd_HHMMSS_UTC, an integer vector the number of seconds since the epoch.

Note

Missing values are mapped to NA_integer_ as would be expected, but so too are dates not in the above format, including for example 1/2/2000 (no leading zeroes).

Examples

1
2
ddmmyyyy2Int("02/02/2020")
yyyymmdd_HHMMSS_UTC("2021-05-05 00:55:55")

HughParsonage/dhhs documentation built on Dec. 17, 2021, 11:22 p.m.