powered by
Corrects "timeDate" objects if they do not fulfill the ISO8601 midnight standard.
"timeDate"
midnightStandard2() relies on strptime wherever possible, and there simply returns as.POSIXct(strptime(charvec, format, tz = "GMT")).
midnightStandard2()
strptime
as.POSIXct(strptime(charvec, format, tz = "GMT"))
midnightStandard (charvec, format) midnightStandard2(charvec, format)
midnightStandard returns a character and
midnightStandard
character
midnightStandard2 a POSIXct object.
midnightStandard2
POSIXct
a character string or vector of dates and times.
a string, the format specification of the input character vector.
ch <- "2007-12-31 24:00" midnightStandard(ch) (ms2 <- midnightStandard2(ch)) class(ms2)
Run the code above in your browser using DataLab