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

Calander control - pre set formats

Hi,
I am using calander control. I would like to set the formats of the date. if i set mm/dd/yyyy even then i am assigning DateTime it should trim the DateTime and just assign only the preset Date Format which is mm/dd/yyyy

Regard,
Prasanna


1 Reply

RP Rekha P Syncfusion Team January 2, 2009 08:37 AM UTC

Hi Prasanna,

Thank you for your interest in Syncfusion Products.

The DropDownCalendar control offers various pre-defined formats, in which the date-time values can be displayed, by setting the required option to the Format property which represents the date-time format of the control with the options of Long, Short, Time, CustomChar and CustomString. In order to set the date format as MM/dd/yyyy, please refer the code snippet below.

[ASPX]

Format="CustomString"
CustomFormat="MM/dd/yyyy">


For Calendar control, the date format 'MM/dd/yyyy' can be set as,

TextBox1.Text = Calendar1.SelectedDate.ToShortDateString();

Also please refer the sample files below to achieve this.

http://websamples.syncfusion.com/samples/Grid.Web/6.4.0.15/F78810-Calendar/Grid_Web_CalendarFormat.zip

Please let me know if this helps you.

Thanks,
Rekha


Loader.
Live Chat Icon For mobile
Up arrow icon