--- 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 - Date **date** - The date to set to midnight. - Results Date - The new date set to midnight. ## Code Examples ```python title="Code Snippet" midnight(now()) //This will take the current date and set the time to midnight ```