--- title: "system.date.midnight" description: "Returns a copy of a date with the hour, minute, second, and millisecond fields set to zero." --- # system.date.midnight > Returns a copy of a date with the hour, minute, second, and millisecond fields set to zero. This function is used in **Python Scripting**. ## Description ## Client Permission Restrictions This scripting function has no [Client Permission](ignition-modules\vision\vision-project-properties\vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax `system.date.midnight(date)` ### Parameters Type | Parameter | Description ------- | ------- | ------ Date | `date` | The starting date. ### Returns **Date** - A new date, set to midnight of the day provided ### Scope Gateway, Vision Client, Perspective Session ## Code Examples ```python title="Code Snippet" # This example prints out the current date with the time set to midnight. date = system.date.now() print system.date.midnight(date) ```