Format dd/mm/yyy hh/mm in cell? how?


#1

how can i import data of the format dd/mm/yyyy hh/mm?
Every time i import this in a cell, it gives an ouput like 32456654,64564
Is it done by using style.custom?


#2

Hi,

You can set the number format as following:
1. Set the number format in your designer file
2. Use Style.Number or Style.Custom to set the number format


#3

is it possible to provide me some example code?
thnx


#4

Excel excel = new Excel();

Cells cells = excel.Worksheets[0].Cells;

cells[“A1”].PutValue(DateTime.Now);

cells[“A1”].Style.Custom = “dd/mm/yy hh:mm”;