The UTC offset was omitted by the WP date query, so the UTC timestamp returned by time() was compared to a local timestamp.