Best timestamp format for CSV/Excel?

Jon picture Jon · Apr 29, 2009 · Viewed 131.6k times · Source

I'm writing a CSV file. I need to write timestamps that are accurate at least to the second, and preferably to the millisecond. What's the best format for timestamps in a CSV file such that they can be parsed accurately and unambiguously by Excel with minimal user intervention?

Answer

Joe picture Joe · Apr 29, 2009

For second accuracy, yyyy-MM-dd HH:mm:ss should do the trick.

I believe Excel is not very good with fractions of a second (loses them when interacting with COM object IIRC).