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

timeDate-midnightStandard

Midnight Standard


Description

Corrects 'timeDate' objects if they do not fulfill the ISO8601 midnight standard.

midnightStandard2() relies on strptime wherever possible, and there simply returns as.POSIXct(strptime(charvec, format, tz = "GMT")).

Usage

midnightStandard (charvec, format)
midnightStandard2(charvec, format)

Arguments

charvec

a character string or vector of dates and times.

format

a string, the format specification of the input character vector.

Value

midnightStandard returns a character and midnightStandard2 a POSIXct object.

Examples

ch <- "2007-12-31 24:00"
   midnightStandard(ch)
   (ms2 <- midnightStandard2(ch))
   class(ms2)

timeDate

Rmetrics - Chronological and Calendar Objects

v3043.102
GPL (>= 2)
Authors
Diethelm Wuertz [aut], Tobias Setz [cre], Yohan Chalabi [ctb], Martin Maechler [ctb], Joe W. Byers [ctb]
Initial release
2018-02-21

We don't support your browser anymore

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