# Date and Time Fields

The ***Date*** and ***DateTime*** elements allow you to add a calendar where the user can select a day, month, and year (and, in the case of ***DateTime***, also a time). Unlike other options for entering the same type of data (e.g., a text field with masks), these tools are especially useful for standardizing formats and avoiding errors when inputting information.

## Date

Date fields can be used to pinpoint important events in time or set deadlines. Since their function is very specific, their customization options are limited, and the format will already be predefined.

<figure><img src="https://1817123835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6gW1YnQoR7lwDfSXSQR9%2Fuploads%2Fgit-blob-8981aa2ab21889794cc89c424063a223b80f1a66%2Fbuild_elementos_higlight_field_date.png?alt=media" alt=""><figcaption><p>Insertion of a <em><strong>Date</strong></em> field</p></figcaption></figure>

We will add a required ***Date*** field in the "Personal Information" section of the form so that the user can select their date of birth. To do this, we will reorganize the existing fields in this section, reducing the space allocated for the ID and tax key so that they appear on the same row. Remember to go to ***Properties > General > Size*** and adjust the size of both fields to 6 units so they occupy half the space. They will automatically rearrange, freeing up space below to insert the new ***Date*** component.

Once added, we will define the value “fecha\_nacimiento” for the ***Name*** property, which will be registered internally, and the value “Date of Birth” for the ***Label*** property, which the user will see.

{% embed url="<https://youtu.be/BQhyNHkiDjc>" %}

## DateTime

The ***DateTime*** field works similarly, except that it includes a space for the time, which is useful for scheduling meetings, specifying reception or delivery times, and setting more precise deadlines, among other possibilities. The time format is also predefined by default in hours, minutes, and seconds.

<figure><img src="https://1817123835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6gW1YnQoR7lwDfSXSQR9%2Fuploads%2Fgit-blob-757599807072b88e5e879025f08bae694c2cc31b%2FRPA_2_18.png?alt=media" alt=""><figcaption><p>Comparison of <em><strong>Date</strong></em> and <em><strong>DateTime</strong></em> fields</p></figcaption></figure>
