开发者

Sharepoint DateTimeControl

How to开发者_运维知识库 format date in Sharepoint DateTime Control?


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


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜