--- title: "setTime" description: "Takes in a date, and returns a copy of it with the time fields set as specified." --- # setTime > Takes in a date, and returns a copy of it with the time fields set as specified. **This function is used by Ignition's Expression language.** ## Description Takes in a date, and returns a copy of it with the time fields set as specified. Note that the millisecond field is not preserved. ## Syntax `setTime(date, hour, minute, second)` ### Parameters | Type | Parameter | Description | |---------|-----------|-----------------------------------------------| | Date | `date` | A starting date. | | Integer | `hour` | The value to set the hour field to. | | Integer | `minute` | The value to set the minute field to. | | Integer | `second` | The value to set the second field to. | ### Returns **Date** - A new date with the time fields set as specified. The millisecond field is not preserved. ## Examples ```python title="Code Snippet" setTime({Root Container.Calendar.date}, 1, 37, 44) //This example will set the date object to the current date with the time set to 01:37:44. ```