Reworked solution to account for logging in on the same midnight