# Date and time

## Overview

> info  **PREREQUISITES**: You must have Sitefinity CMS version 15.4.8622 or newer.

This widget allows users to enter dates and time.

After you have added the *Date and time* form widget in your form and opened its settings, the *Date and time* window appears, displaying the following sections:

## Labels and content

1. In the Label input field, enter the label of the Date and time field.\
   For example, `Departure date` or `Departure time.`
2. If needed, in *Instructional text*, enter instructions or explanatory text for the Date and time field.\
   The text is displayed bellow the Date and time field.
3. Select the *Display* mode from one of the three options:
   * Date
   * Date and time
   * Time
4. If you want to make the date and time field mandatory, select the *Required field* checkbox\
   A textbox appears, where you enter the error message that is displayed, if the user does not select anything.
5. If you want this field to be visible in the form only when certain conditions are met, select *Hide field initially* checkbox.\
   You can then use form ruled to display the field. For more information, see [Form rules](https://www.progress.com/documentation/sitefinity-cms/form-rules).

## Display settings

In this section, perform the following:

1. In *Template* dropdown, you can select a template other than the default one that will be used to display the multiple choice on the website.\
   You must first have created a custom template.\
   For more information, see [Next.js pages and templates](https://www.progress.com/documentation/sitefinity-cms/next.js-pages-and-templates).
2. Select the size of the fields.

## Advanced settings

To open the advanced settings, in the upper-right corner of the *Date and time* widget page, click ![DotNetCore11](https://www.progress.com/documentation/sitefinity-cms/assets/0b5bf6d61861bf099d7f849dde3e94ea/settings-dotnetcore.jpg "DotNetCore11") (*Advanced settings*).

### Apply custom CSS

In *CSS class* input field, you can choose a class name for the *Date and time* choice, if later you want to set a CSS style for this particular widget.

### Developer name

You can change the automatically generated name for developers of this *Date and time* by and entering the new name in the input field that appears.\
This is the name of the field that is used by developers to refer to this *Date and time* in the code.

Save your changes.
