prachee
prachee

Reputation: 11

Sharepoint DateTimeControl

How to format date in Sharepoint DateTime Control?

Upvotes: 1

Views: 2716

Answers (3)

Edward Nguyen
Edward Nguyen

Reputation: 1

You can use Custom format property

dateTimePicker1.Format = DateTimePickerFormat.Custom; dateTimePicker1.CustomFormat = "MMMM dd, yyyy - dddd";

Reference: https://msdn.microsoft.com/en-us/library/system.windows.forms.datetimepicker.customformat%28v=vs.71%29.aspx

Upvotes: 0

Sedigheh
Sedigheh

Reputation: 26

set DateTimeControl.LocaleId = Convert.ToInt32(SPContext.Current.RegionalSettings.LocaleID)

Upvotes: 0

Raymund
Raymund

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

Related Questions