We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Formatting cells as time values


How would I format a column of cells to be type "Time"? What I want is similar to setting the Category to "Time" and the Type to a particular format as is done in Excel by using the Format Cells dialog box.

Thanks...

Sean

1 Reply

MW Melba Winshia Syncfusion Team June 28, 2007 08:15 AM UTC

Hi Sean,

You can format cells as time values by using the following code snippets:

[C#]

sheet.Range["C2"].NumberFormat = "h:mm:ss";

Here is the sample for your reference:

http://websamples.syncfusion.com/samples/XlsIO.Windows/63089/main.htm

Kindly let me know if you have any other questions.

Thanks,
Melba

Loader.
Live Chat Icon For mobile
Up arrow icon