--- title: "Date Block" slug: "date-block" updated: 2022-08-22T07:24:39Z published: 2022-08-22T07:24:39Z canonical: "help.pillir.io/date-block" --- > ## 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 Block Date All operations that pertain to date and time are modeled in this block. ## New Date: Returns a 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 Properties: The Date Properties are: Full Year, Month, Day, Date, Hours, Minutes, Seconds, Milliseconds, Time | **Input** | **Output** | **Block Layout** | **Generated Code** | | --- | --- | --- | --- | | Select the type of date property, Date input as a variable or data object. | 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 From Text: | **Input** | **Output** | **Block Layout** | **Generated Code** | | --- | --- | --- | --- | | Date Text value as a variable or text, Format value as a variable or text. | Returns Date Object for the given format. | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620914516438.png) | ```javascript pillirFunctions. date_new_date ('2020/01/12', 'YYYY/MM/DD') ``` | #### ## Date To Text: | **Input** | **Output** | **Block Layout** | **Generated Code** | | --- | --- | --- | --- | | Date object value as a variable or a date object, Format value as a variable or text. | 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 pillirFunctions. date_to_string ((new Date()), 'YYYY/MM/DD') ``` |