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.

DateTimePickerAdv ShortDate + Time format

Thread ID:

Created:

Updated:

Platform:

Replies:

60454 May 4,2007 05:43 PM May 7,2007 02:30 PM Windows Forms 2
loading
Tags: Tools
Julie Levy
Asked On May 4, 2007 05:43 PM

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

Murugan [Syncfusion]
Replied On May 4, 2007 09:05 PM

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


Julie Levy
Replied On May 7, 2007 02:30 PM

Thanks!

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.

;