在R中格式化日期/时间
使用R,如何从这里将日期和时间转换为“标准”日期/时间字符串格式 2020-12-30T03:32:30.000Z在R中格式化日期/时间,r,date,time,format,R,Date,Time,Format,使用R,如何从这里将日期和时间转换为“标准”日期/时间字符串格式 2020-12-30T03:32:30.000Z 使用?strtime strptime("2020-12-30T03:32:30.000Z", "%Y-%m-%dT%H:%M:%S") # [1] "2020-12-30 03:32:30 CET" 使用?strtime strptime("2020-12-30T03:32:30.000Z", &q
使用
?strtime
strptime("2020-12-30T03:32:30.000Z", "%Y-%m-%dT%H:%M:%S")
# [1] "2020-12-30 03:32:30 CET"
使用
?strtime
strptime("2020-12-30T03:32:30.000Z", "%Y-%m-%dT%H:%M:%S")
# [1] "2020-12-30 03:32:30 CET"
您还可以使用:
#Code
as.POSIXct(gsub('T|Z',' ','2020-12-30T03:32:30.000Z'),'%Y-%m-%d %H:%M:%S.%OS')
输出:
[1] "2020-12-30 03:32:30 GMT"
您还可以使用:
#Code
as.POSIXct(gsub('T|Z',' ','2020-12-30T03:32:30.000Z'),'%Y-%m-%d %H:%M:%S.%OS')
输出:
[1] "2020-12-30 03:32:30 GMT"