Date format that is guaranteed to be recognized by Excel

后端 未结 2 581
执笔经年
执笔经年 2020-12-19 07:08

We\'re exporting our analytics reports in various formats, among them CSV. For some clients this CSV finds it\'s way into Excel.

Inside the CSV file one of the colum

相关标签:
2条回答
  • 2020-12-19 07:44

    You have two options. Go with the month as a string and the year as 4 digits, or use ISO formatting: yyyy-mm-dd.

    0 讨论(0)
  • 2020-12-19 07:49

    If you format your dates as follows in the csv output, Excel will parse the content exactly as a date (other columns for realism only)

    43,somestring,="03/03/2003",anotherval
    55,anotherstring,="01/02/2004",finalval
    

    so add ="{date}" and it parses as date!

    0 讨论(0)
提交回复
热议问题