保证由Excel识别的日期格式 [英] Date format that is guaranteed to be recognized by Excel

查看:293
本文介绍了保证由Excel识别的日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正以各种格式(其中包括CSV)导出我们的分析报告。



在CSV文件中,其中一列是日期,例如

 开始日期,名称
07-04-2010,Maxim
pre>

Excel无法解析此日期格式,显然取决于用户的语言环境。 07是日期或月份...



你能为日期字段推荐一些文本格式,而不会有麻烦的解析?我的目标是尽可能多的故障安全选项。我会安排一些转义序列,这将导致excel避免解析列中的文本。



感谢您的帮助,
Maxim。

解决方案

您有两个选择。使用月份作为字符串,年份为4位数,或使用ISO格式:yyyy-mm-dd。


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 columns is a Date, for example

"Start Date","Name"
"07-04-2010", "Maxim"

Excel has trouble parsing this date format, obviously depending on the Locale of the user. Is "07" is the day or the month...

Could you recommend some textual format for a Date field that excel will not have trouble parsing? I'm aiming at the most fail safe option possible. I would settle for some escape sequence that will cause excel to avoid parsing the text in the column altogether.

Thanks for helping, Maxim.

解决方案

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

这篇关于保证由Excel识别的日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆