导出到Excel日期格式错误 [英] Export To Excel Date Format Error

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

问题描述

你好,

我有一个问题,同时按日期格式导出网格错误
我的网格日期格式为M/D/YYYY,而我的系统格式为DD-MM-YYYY

Hello,

I have a Problem , while Exporting my grid error on date format
my grid date format is M/D/YYYY and my system Format is DD-MM-YYYY

/*
my grid eg:   
                 
             Start Date   End Date
             1/1/2011     12/31/2011

exported to Excel shows like

             Start Date   End Date
             01-01-2011   12/31/2011

*/




请帮我



在Advance中致谢




Pls Help me



Thanks in Advance

推荐答案

您需要将Excel中的单元格格式设置为"d/m/yyyy"-当前设置为"dd/mm/yyyy"插入前导零.查看 Excel.Range.NumberFormat [ ^ ]属性.
You need to set the cell format in Excel to "d/m/yyyy" - currently it is set to "dd/mm/yyyy" which inserts leading zeros. Look at the Excel.Range.NumberFormat [^] property.


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

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