The due date is determined by the phrase "It has to be paid before X date" and not including the present day. For example, If the due date for an invoice is August 9th, once the date is technically beyond 12:00 AM on August 9th, the badge will show up as 'past due' as it had to be paid before August 9th.
All times for invoices are generated in UTC.