refactor: clean up time & date functions

* replace all `var` declarations and use `const` where appropriate
* strip unnecessary temporary variables
* replace single character variable names
* replace multiline variable declarations
* simplify expressions
* replace invalid uses of parseInt
1 job for kmohrf/cleanup in 1 minute and 39 seconds (queued for 4 seconds)