import datetime
return datetime.datetime.strptime(value, "%m/%d/%Y %H:%M:%S.%f")
import datetime
import time
date = datetime.datetime.strptime(value, "%m/%d/%Y %H:%M:%S.%f")
return time.mktime(date.timetuple()) + date.microsecond * 1e-6
--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
value.toDate("M/d/y H:m:s")
value.toDate("M/d/y H:m:s.S")
value.replace(/\d$/,'').toDate("MM/dd/y H:m:s.S")
--
The "milliseconds" part is invisible in the date format you get (2016-05-18T11:54:26Z), but rest assured, it's there. You can verify that by retransforming your string to date using :
value.toDate().toString("dd/MM/yyy h:m:s.S")
18/05/2016 11:54:26.555
18/05/2016 11:54:26.788
value.toDate('MM/dd/yyyy hh:mm:ss.S')
value.toDate('MM/DD/YYYY hh:mm:ss')