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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Using MaskEdit for DateTime shows Time in 12-Hour Format

Thread ID:





97622 Dec 17,2010 02:52 PM UTC Dec 20,2010 06:26 AM UTC ASP.NET Web Forms (Classic) 1
Tags: Tools
Scott Numbers
Asked On December 17, 2010 02:52 PM UTC

I am using MaskEdit in a DataBound Grid and am experiencing a problem with getting the time formatted as 24-hour time. I would like a DateTime value such as 1/1/2011 10:15:34 PM to show in the grid as 1/1/2011 22:15. I have the Style.Format set to the .Net DateTime Format that I want: "MM/dd/yyyy HH:mm" but the MaskEdit apparently does not use this. I also tried altering the formats in the MaskEdit.DateTimeFormatInfoObject and that did not work.

Any help with getting the Time portion of a DateTime value in a MaskEdit control to show in 24-hour format would be greatly appreciated.

Scott Numbers

Varalakshmi R.S [Syncfusion]
Replied On December 20, 2010 06:26 AM UTC

Hi Scott,

Thank you for your interest in Syncfusion products.

The mask format “Mask="##/##/#### ##:##” in the MaskedEditControl just displays the given input value in DateTime format. So, we suggest you to use DateTimeTextBox for assigning 24 hour time format.

This can be set by using the following code,

DateTimeTextBox1.Format = DateTimeFormatType.CustomString;
DateTimeTextBox1.CustomFormat = "MM/dd/yyyy HH:mm:ss:ff tt"; //HH:mm:ss:ff tt denotes the 24 hour time format

Kindly refer the following link to know more information on TimeFormat in DateTimeTextBox.

Please let me know if this helps,



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

Live Chat Icon For mobile
Live Chat Icon