# DateTimeMaskedTextProvider class

Namespace: [Eto.Forms](https://eto.picoe.ca/api/namespace/eto.forms.md) · Assembly: [Eto](https://eto.picoe.ca/api/assembly/eto.md) · Since v2.12

```cs
public class DateTimeMaskedTextProvider : IMaskedTextProvider<DateTime?>
```

Masked text provider that edits a [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) value using a fixed, culture-aware date and/or time format.

**Remarks:** This provider encapsulates all of the date/time masking, parsing, clamping, and stepping logic so it can be used with either a [MaskedTextStepper<T>](https://eto.picoe.ca/api/type/eto.forms.maskedtextstepper-1.md) or a [MaskedTextBox<T>](https://eto.picoe.ca/api/type/eto.forms.maskedtextbox-1.md). For a stepper, the [DateTimeMaskedTextProvider.GetStepValue(int, int, int)](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/getstepvalue.md) helper can be used from [TextStepper](https://eto.picoe.ca/api/type/eto.forms.textstepper.md)'s step handling to increment or decrement the segment at the caret. For a text box, simply assigning the provider gives masked, culture-aware date entry without stepping. The [DateTimeMaskedTextStepper](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextstepper.md) control wraps this provider with the appropriate control configuration.

## Constructors

- [DateTimeMaskedTextProvider](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/ctor.md): Initializes a new instance of the [DateTimeMaskedTextProvider](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider.md) class.

## Properties

- [Culture](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/culture.md): Gets or sets the culture used for the format and separators.
- [DisplayText](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/displaytext.md): Gets the display text, including prompt characters.
- [EditPositions](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/editpositions.md): Gets an enumeration of all valid edit positions in the mask.
- [IsEmpty](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/isempty.md): Gets a value indicating the mask is empty with no characters filled out.
- [MaskCompleted](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/maskcompleted.md): Gets a value indicating whether the mask has all required text to pass its validation.
- [MaxDate](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/maxdate.md): Gets or sets the maximum allowed date/time value.
- [MinDate](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/mindate.md): Gets or sets the minimum allowed date/time value.
- [Mode](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/mode.md): Gets or sets the visible date/time editing mode.
- [PromptChar](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/promptchar.md): Gets or sets the prompt character used for unfilled edit positions.
- [Text](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/text.md): Gets or sets the text, usually excluding prompt or literal characters depending on the mask provider.
- [Value](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/value.md): Gets or sets the current value, parsing and clamping the masked text as needed.

## Methods

- [Clamp](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/clamp.md): Clamps the specified value to the [DateTimeMaskedTextProvider.MinDate](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/mindate.md) and [DateTimeMaskedTextProvider.MaxDate](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/maxdate.md) range.
- [Clear](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/clear.md): Called to clear a range of characters at the specified position in the masked text.
- [CommitText](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/committext.md): Called to update the display text after changes to the mask value.
- [Delete](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/delete.md): Called to delete a range of characters at the specified position in the masked text.
- [GetStepValue](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/getstepvalue.md): Computes the value after stepping the segment at the specified caret index up or down.
- [Insert](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/insert.md): Called to insert a character at the specified position in the masked text.
- [Replace](https://eto.picoe.ca/api/type/eto.forms.datetimemaskedtextprovider/replace.md): Called to replace a character at the specified position in the masked text.
