added check for day change because of timezone offset