I have a script which outputs a CSV file. How should I format dates or date+time fields so that Excel will correctly parse that field as a date?
PS: I'd like to keep timezone information intact as well.
On the Home tab, in the Number group, click the Dialog Box Launcher next to Number. You can also press CTRL+1 to open the Format Cells dialog box. In the Category list, click Date or Time. In the Type list, click the date or time format that you want to use.
Explanation: Dates and times with a format that begins with an asterisk (*) automatically update based on your PC's regional settings.
To change the date or time format, right-click on a cell, and select Format Cells. Then, on the Format Cells dialog box, in the Number tab, under Category, click Date or Time and in the Type list, select a type, and click OK.
Excel's date format does not contain any information about time zones. I would export the time zone as a separate column, perhaps as an offset from GMT, like 5 or -2. I personally prefer the unambiguous yyyy-mm-dd date format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With