开发者

How to format a datetime so that Excel will understand it?

开发者 https://www.devze.com 2022-12-29 14:02 出处:网络
I have a script which outputs a CSV file. How should I format date开发者_如何学Cs or date+time fields so that Excel will correctly parse that field as a date?

I have a script which outputs a CSV file. How should I format date开发者_如何学Cs 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.


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.


I would use the "dd/mm/yyyy hh:nn:ss" format. I have never had any problems with Excel understanding this format before.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号