Date Formatting Question


#1
HI,
I have a query in date formatting.In Excel, if I enter the following text into a cell ...
01 Oct 06 12:35
it will get reformatted as soon as I leave the cell using my local date format ...
01/10/2006 12:35
which is just what I want.
When I use cells[row,col].PutValue("01 Oct 06 12:35"), the text doesn't get reformatted until I click on the cell in the generated worksheet and move away from it. How can I get the reformatting to take place automatically without the user having to click on the cells?
As we have users around the world I would like the finished worksheet to display dates using their own localised format.
Rgds,
Soumya

#2

Please try:

You can try:

Workbook wb = new Workbook();
wb.Worksheets[0].Cells[0, 0].PutValue(DateTime.Parse("01 Oct 06 12:35"));
wb.Worksheets[0].Cells[0, 0].Style.Custom = "d/m/yyyy h:mm";

wb.Save("d:\\test\\abc.xls");