Kirill
Kirill

Reputation: 37

DevExpress.XtraEditors.DateEdit set datetime value

I need to assign DateTime value to DevExpress.XtraEditors.DateEdit. Are there any ideas to write such datetime values as: days, years, months, hours and so on? Thanks.

Upvotes: 0

Views: 15456

Answers (1)

DmitryG
DmitryG

Reputation: 17850

I believe you are talking about display formatting and mask "days, years, months, hours ..."
If so, you can use the followihg code:

// 31, 2012, December, 23:59:59
dateEdit1.EditValue = new System.DateTime(2012, 12, 31, 23, 59, 59);
dateEdit1.Properties.Mask.EditMask = "dd, yyyy, MMMM, HH:mm:ss";
dateEdit1.Properties.Mask.UseMaskAsDisplayFormat = true;

Related help article: Mask Type: Date-time

Upvotes: 4

Related Questions