make_datetime {lubridate}R Documentation

Efficient creation of date-times from numeric representations.

Description

make_datetime is a very fast drop-in replacement for base::ISOdate and base::ISOdatetime.

Usage

make_datetime(year = 1970, month = 1L, day = 1L, hour = 0, min = 0,
  sec = 0, tz = "UTC")

Arguments

year

numeric year

month

numeric month

day

numeric day

hour

numeric hour

min

numeric minute

sec

numeric second

tz

time zone. Defaults to UTC.

Details

Input vectors are silently recycled. All inputs except sec are silently converted to integer vectors. Seconds sec can be either integer or double.

Examples

make_datetime(year = 1999, month = 12, day = 22, sec = 10)
## "1999-12-22 00:00:10 UTC"
make_datetime(year = 1999, month = 12, day = 22, sec = c(10, 11))
## "1999-12-22 00:00:10 UTC" "1999-12-22 00:00:11 UTC"

[Package lubridate version 1.5.6 Index]