Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

make_datetime

Efficient creation of date-times from numeric representations


Description

make_datetime() is a very fast drop-in replacement for base::ISOdate() and base::ISOdatetime(). make_date() produces objects of class Date.

Usage

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

make_date(year = 1970L, month = 1L, day = 1L)

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; sec can be either integer or double.

Examples

make_datetime(year = 1999, month = 12, day = 22, sec = 10)
make_datetime(year = 1999, month = 12, day = 22, sec = c(10, 11))

lubridate

Make Dealing with Dates a Little Easier

v1.7.10
GPL (>= 2)
Authors
Vitalie Spinu [aut, cre], Garrett Grolemund [aut], Hadley Wickham [aut], Ian Lyttle [ctb], Imanuel Costigan [ctb], Jason Law [ctb], Doug Mitarotonda [ctb], Joseph Larmarange [ctb], Jonathan Boiser [ctb], Chel Hee Lee [ctb], Google Inc. [ctb, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.