Best timestamp format for CSV/Excel?

前端 未结 11 2206
盖世英雄少女心
盖世英雄少女心 2020-12-07 16:57

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

11条回答
  •  一整个雨季
    2020-12-07 17:47

    Given a csv file with a datetime column in this format: yyyy-mm-dd hh:mm:ss

    Excel shows it in this format: dd/mm/yyyy hh:mm

    e.g. 2020-05-22 16:40:55 shows as 22/05/2020 16:40

    This is evidently determined by the Short date and Short time format selected in Windows; for example, if I change the Short date format in Windows to yyyy-mm-dd, Excel shows 2020-05-22 16:40.

    Annoyingly, I can't find any way to make Excel show the seconds automatically (I have to manually format the column in Excel). But if the csv file includes a time column in hh:mm:ss format (e.g. 16:40:55), that's what shows in Excel, including the seconds.

提交回复
热议问题