Add temp table and indexes for GMT times
Make database queries on GMT rather than local time
Clean up the temp table once a day
Closed parentheses