Skip to main content

DateTimeMask Class

Defines built-in patterns for date-time and date-time offset masks.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public static class DateTimeMask

Remarks

Use properties of the DateTimeMask class to apply commonly used mask patterns to data editors. Each property is a wrapper for the corresponding standard date and time format string. This technique simplifies the setup process.

<DxDateEdit @bind-Date="Value"
            Mask="@DateTimeMask.ShortDate" />
@code {
    DateTime Value { get; set; } = DateTime.Now;
}

Date-Time Masks - ShortDate

The appearance of a mask pattern depends on the current culture. For instance, the same mask can specify different patterns in the U.S. and France.

Users can change the regional format in the SettingsTime & LanguageRegion system dialog. To change the culture programmatically, use the Culture property. The culture’s DateTimeFormat property defines the culture-specific date-time format.

Inheritance

Object
DateTimeMask
See Also