Reputation: 11
How to format date in Sharepoint DateTime Control?
Upvotes: 1
Views: 2716
Reputation: 1
You can use Custom format property
dateTimePicker1.Format = DateTimePickerFormat.Custom; dateTimePicker1.CustomFormat = "MMMM dd, yyyy - dddd";
Upvotes: 0
Reputation: 26
set DateTimeControl.LocaleId = Convert.ToInt32(SPContext.Current.RegionalSettings.LocaleID)
Upvotes: 0
Reputation: 7892
DateTimeControl.LocaleId = SPContext.Current.RegionalSettings.LocaleId
Or put the LocaleId if it does not work, I encounter that sometimes
i.e
DateTimeControl.LocaleId = 2057 for UK
DateTimeControl.LocaleId = 1031 for German
Upvotes: 2