Speedup conversion of 2 million rows of date strings to POSIX.ct

后端 未结 2 1646
星月不相逢
星月不相逢 2020-12-09 11:31

I have a csv which includes about 2 million rows of date strings in the format:

2012/11/13 21:10:00 

Lets call that csv$Date.and.Time

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 11:54

    You want the small and simple fasttime package by Simon which does this in the fastest possible way---by not calling time parsing functions but just using C-level string functions.

    It does not support as many formats as strptime. In fact, it doesn't even have a format string. But well-formed ISO format variants, that is yyyy-mm-dd hh:mm:ss.fff will work, and your / separator may just work too.

提交回复
热议问题