I want to parse a character with a 5-digit (or more) year, e.g. 10000-01-01 01:00:00 to class POSIXct.
A 4-digit year is of course no problem. For example,
as.POSIXct("1000-01-01 01:00:00")
But with a 5-digit year, e.g. 10000, as.POSIXct errors:
as.POSIXct("10000-01-01 01:00:00")
# Error in as.POSIXlt.character(x, tz, ...) :
# character string is not in a standard unambiguous format
I wonder is there a way to handle year with more than 4 digits in R?