我正在尝试更广泛地使用data.table而ITime
是UDT复制POSIXlt“DateTime”类型。
> strptime("01-04-2012 09:23:45.987364", format="%d-%m-%Y %H:%M:%OS")
[1] "2012-04-01 09:23:45.987364"
> time = strptime("01-04-2012 09:23:45.987364", format="%d-%m-%Y %H:%M:%OS")
> class(time)
[1] "POSIXlt" "POSIXt"
但我无法通过ITime获得ms或micro
> time = as.ITime("09:23:45.987364", format="%H:%M:%OS")
> time
[1] "09:23:45"
如何使用ITime处理分数? 干杯
答案 0 :(得分:4)
似乎不可能。
IDateTime {data.table} R Documentation
Integer based date class
Details
ITime is a time-of-day class stored as the integer number of seconds in the day. as.ITime does not allow days longer than 24 hours. Because ITime is stored in seconds, you can add it to a POSIXct object, but you should not add it to a Date object.