--- title: "midnight" description: "Returns a copy of a date with the hour, minute, second, and millisecond fields set to zero." --- # midnight > Returns a copy of a date with the hour, minute, second, and millisecond fields set to zero. **This function is used by Ignition's Expression language.** ## Description ## Syntax `midnight(date)` ### Parameters | Type | Parameter | Description | |------|-----------|---------------------------| | Date | `date` | The date to set to midnight.| ### Returns **Date** - A new date with the hour, minute, second, and millisecond fields set to zero. ## Examples ```python title="Code Snippet" midnight(now()) //This will take the current date and set the time to midnight ```