Midnight standard
timeDate-midnightStandard.Rd
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"))
.
Arguments
- charvec
a character string or vector of dates and times.
- format
a string, the format specification of the input character vector.
Examples
ch <- "2007-12-31 24:00"
midnightStandard(ch)
#> [1] "2008-01-01 00:00:00"
(ms2 <- midnightStandard2(ch))
#> [1] "2008-01-01 GMT"
class(ms2)
#> [1] "POSIXct" "POSIXt"