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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

convert datatime am,pm format to 24hr

Thread ID:





103233 Apr 13,2012 10:03 PM UTC Apr 18,2012 11:11 AM UTC WinForms 1
Tags: GridControl
Asked On April 13, 2012 10:03 PM UTC

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


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

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

Please let me know if you have any concerns.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon