How to use "CellValueType"

I want to make a cell to show it's content in the value type of DateTime. I think maybe the CellValueType is helpful, but I don't know how to use it.Could u give me a example?Thank u very much!

In Aspose.Excel.Express, please format that cell with date format in your designer file. If you want to set it at run time, please use Aspose.Excel.

You can use Cell.Style to set a cell with datetime format.

For example,

cell.Style.Number = 14;

or

cell.Style.Custom = “mmddyyyy”;

thank u first.
how to show hour:minute?

i have got it .u don’t need to reply.thank u all the same.

@sophiexxh,
This is to inform you that Aspose.Excel is discontinued and no more active development is done for it. A new product Aspose.Cells has replaced it and contains support for all the features in Aspose.Excel as well as supports latest features in different versions of MS Excel. You can set formatting of the cells using this new product as shown in the following sample code:

// Instantiating a Workbook object
Workbook workbook = new Workbook();

// Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.Worksheets[0];

// Adding the current system date to "A1" cell
worksheet.Cells["A1"].PutValue(DateTime.Now);

// Getting the style of A1 cell
Style style = worksheet.Cells["A1"].GetStyle();

// Setting the custom display format to show date as "d-mmm-yy"
style.Custom = "d-mmm-yy";

// Applying the style to A1 cell
worksheet.Cells["A1"].SetStyle(style);



// Saving the Excel file
workbook.Save("book1.xlsx", SaveFormat.Xlsx);

Follow the link below to get detailed information about formatting data in cells:
Data formatting

A free trial version of this product can be downloaded from the following link:
Aspose.Cells for .NET (Latest Version)

A detailed runnable solution is prepared which can be used to test the product features without writing any code. It can be downloaded here.