Parse ISO 8601 combined date and time YYYY-MM-DDTHH-MM-SSZ
问题 I have a large dataframe with time stamps that look like this: "2019-05-15T01:42:15.072Z" It resembles a ISO 8601 combined date and time representation. How can I parse this string into a real date-time format? The characters ( T and Z ) inside the data seems to make it difficult. 回答1: You can simply parse the timestamp by specifying the format in as.POSIXct (or strptime ) as.POSIXct("2019-05-15T01:42:15.072Z", format = "%Y-%m-%dT%H:%M:%OSZ") #[1] "2019-05-15 01:42:15 AEST" Explanation: %Y ,