Addressing the comments in the pull. Namely specifying in the variable day, that it is in ms and fixing the timeout until midnight.