--- title: "Date Component" slug: "date-component" updated: 2023-02-13T09:57:20Z published: 2023-02-13T09:57:20Z canonical: "help.pillir.io/date-component" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.pillir.io/llms.txt > Use this file to discover all available pages before exploring further. # Date Component The Date component consists of blocks that perform all operations related to date and time. ## New Date This block returns the current date as an object. | Block Layout | Generated Code | | --- | --- | | ![Date](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/Date.png) | ```javascript new Date(); ``` | ## Date Format This block returns the date object in the default format. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Date Text value as a variable or text - input-1 Format of the date text (input-1)as a variable or text - input-2 | Returns the default Date format for the given date. | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620914516438.png) | ```javascript __er.newDate('2020/01/12', 'YYYY/MM/DD'); ``` | ## Date Properties This block returns the details of the date property selected for a specified date. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Select the type of date property from the dropdown list Date input as a variable or object - input-1 | Returns the data property as text | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620914469434.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620914488282.png) | ```javascript (new Date()).getFullYear(); ``` | ## Date to Text This block returns the date in a string format. | Input | Output | Block Layout | Generated Code | | --- | --- | --- | --- | | Date object value as a variable or a date object - input-1 Format value as a variable or text - input-2 | Returns Date as a text value for the given format. | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620914540010.png) | ```javascript __er.dateToString((new Date()), 'YYYY/MM/DD'); ``` |