Fixes #4380, make sure site's timezone is applied when selecting log data to aggregate. Includes integration test + doc fixes to Date function.