Skip to main content
A newer version of this page is available. .
All docs
V20.2

DateTimeOffsetEdit Class

The editor that manages values of the System.DateTimeOffset type.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v20.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public class DateTimeOffsetEdit :
    BaseSpinEdit

Remarks

The DateTimeOffsetEdit editor has the DateTimeOffset mask that allows users to enter values in the “MM/DD/YYYY HH:MM:SS AM(PM) +(-)HH:MM” format. You can modify this mask via the Properties.MaskSettings property.

dateTimeOffsetEdit1.Properties.MaskSettings.MaskManagerType = typeof(DateTimeOffsetMaskManager);
dateTimeOffsetEdit1.Properties.MaskSettings.MaskExpression = "hh:mm (zzz)";
//or
dateTimeOffsetEdit1.Properties.MaskSettings.Configure<MaskSettings.DateTimeOffset>(settings => {
    settings.MaskExpression = "hh:mm (zzz)";
});
//or
var dtSettings = dateTimeOffsetEdit1.Properties.MaskSettings.Configure<MaskSettings.DateTimeOffset>();
dtSettings.MaskExpression = "hh:mm (zzz)";

The editor drop-down panel changes its layout according to the active mask.

different drop-down layouts

To assign a DateTimeOffset value to this editor or read the current editor value, use the DateTimeOffset property.

dateTimeOffsetEdit1.DateTimeOffset = DateTimeOffset.Now.AddDays(5);
See Also