开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜