显示记录时出现CSV日期格式问题 [英] CSV date format issue while showing the records
问题描述
在我的应用程序中,用户选择他们想要的报告格式。他们输入一个格式如2000-1-4的数字,然后他们选择CSV格式,根据这个数字的数据填充在该CSV。
现在的问题是,当他们输入这个数字,可以是一个日期像2012-1-4,然后在CSV这个数字被转换为1/4/2012这是错误的,但是当他们给数字像883-17-8然后它的到来,因为它是罚款。
有什么办法可以解决这个问题吗?有人请帮我。
In my application, user select in which format they want the report. They enter one number which is format like 2000-1-4 and then they select CSV format and the data according to this number gets populated in that CSV.
Now the problem is when they enter this number which can be a date like 2012-1-4 then in CSV this number gets converted into 1/4/2012 which is wrong but when they give number like 883-17-8 then its coming as it is which is fine.
Is there any way i can resolve this? Someone please help me on this.
推荐答案
值的显示方式取决于操作系统的区域设置。 (例如,Windows 7的区域和语言)。在额外的seetings还有spcified CSV分隔符(列表分隔符)等。
How the value is displayed depends on regional settings of operating system. (E.g. for windows 7 see Region and Language). In additional seetings there is also spcified CSV separator (List separator), etc..
这篇关于显示记录时出现CSV日期格式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!