Click here to Skip to main content
15,889,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

*/



Pls Help me



Thanks in Advance
Posted
Updated 7-Feb-11 18:45pm
v2

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900