Date format that is guaranteed to be recognized by Excel

后端 未结 2 582
执笔经年
执笔经年 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: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!

提交回复
热议问题