Coldfusion: cfspreadsheet reading date incorrectly

徘徊边缘 提交于 2019-12-13 02:56:27

问题


Im using cfspreadsheet to read data from spreadsheets inside one of my applications. I've had a great deal of difficulty dealing with date columns. If I format the cell as date english (NZ) it displays right in the spreadsheet, but when I try to upload it switched the day and month. But If I change the format to a custom "dd/mm/yyyy" format it will upload without a problem.

Why would using the default date formats within the spreadsheet mess up the format when a custom one doesn't? Is there a work around?


回答1:


I was using the Date Type "*14/03/2001".

The * means that it will: respond to changes in regional date and time settings that are specified for the operating system.

So it must have been getting turned about by java or CF somewhere along the way. I changed it to the same date mask without the asterisk and the problem stopped occurring.



来源:https://stackoverflow.com/questions/12926719/coldfusion-cfspreadsheet-reading-date-incorrectly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!