DateTimePickerAdv ShortDate + Time format

Hi -
I need to display a format which is the shortdate + time and it needs to pick up the local culture of the machine ( i don't want to set a custom format where i determine the month/day/year order, etc.).

How do i do this with the DateTimePickerAdv.

I am using version 4.4.0.51 and .NET 2.0
Thanks,
Julie

2 Replies

MU Murugan Syncfusion Team May 5, 2007 01:05 AM UTC

Hi Julie,

The local culture of the machine could be assigned by using UseCurrentCulture property of the DateTimePickerAdv class. The UseCurrentCulture property sets the system DateTime culture to the DateTimePickerAdv control.

[C#]
this.dateTimePickerAdv1.UseCurrentCulture = true;
this.dateTimePickerAdv1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dateTimePickerAdv1.CustomFormat = this.dateTimePickerAdv1.Culture.DateTimeFormat.ShortDatePattern.ToString () + " " + this.dateTimePickerAdv1.Culture.DateTimeFormat.ShortTimePattern.ToString();

[Sample]
http://websamples.syncfusion.com/samples/Tools.Windows/F60454/Main.htm

Please try this and let me know if this helps.

Thank you for your interest in Syncfusion products.

Regards,
Murugan P.S



JL Julie Levy May 7, 2007 06:30 PM UTC

Thanks!

Loader.
Up arrow icon