开发者

Sharepoint DateTimeControl

开发者 https://www.devze.com 2023-02-27 12:27 出处:网络
How to开发者_运维知识库 format date in Sharepoint DateTime Control?DateTimeControl.LocaleId = SPContext.Current.RegionalSettings.LocaleId

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

精彩评论

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