Refactored day counter to use a real time and date library.