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.
Unfortunately, activation email could not send to your email. Please try again.

convert datatime am,pm format to 24hr

Thread ID:

Created:

Updated:

Platform:

Replies:

103233 Apr 13,2012 06:03 PM Apr 18,2012 07:11 AM Windows Forms 1
loading
Tags: GridControl
Smitha
Asked On April 13, 2012 06:03 PM

Hi,
I am using a grid control in windows forms.
There my data has a datetime format. am.pm.
But while displaying on the grid, i want to convert it to a 24hr format.
What events should i use

Smitha


Mercy C [Syncfusion]
Replied On April 18, 2012 07:11 AM

Hi smitha,

Thanks for your interest in Syncfusion products.

To set 24-hours date time format, please make use of the following code.

this.gridControl1.ColStyles[this.gridControl1.ColCount].CellValueType = typeof(DateTime);
this.gridControl1.ColStyles[this.gridControl1.ColCount].CellValue = DateTime.Now;
this.gridControl1.ColStyles[this.gridControl1.ColCount].Format = "HH:mm:ss:ff";

Please refer to the sample in the following link
http://www.syncfusion.com/downloads/Support/DirectTrac/92112/WindowsFormsApplication8519649990.zip

Please let me know if you have any concerns.

Regards,
Mercy.C


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;