If you've tried setting hours for a location that closes after midnight, you will get an error. This is because the hours have to be entered within the same day. So the latest closing time you could have is 11:59 PM.
If you'd like customers to be able to place online orders past midnight, you can set the closing time for that day for 11:59 PM and the opening hours for the next day to 12:01 AM.
For example, if you have a store that's open on Monday - Friday 10:00 AM to 2:00 AM, your hours would look like this:
In order to avoid customers placing orders between 2:00 AM and 10:00 AM, you can add a Blocked Order Time (instructions in the link at the bottom of this article.)