Fix tests on 4-0-stable

Tests on `4-0-stable` are currently failing (for instance [on Travis](https://travis-ci.org/rails/rails/jobs/41723561)) because the time zone of Moscow/Russia has changed. 

This issue has already been fixed on `master`. Since code changes are still being made to `4-0-stable`, I suggest we backport these two commits from `master` to `4-0-stable`, so tests start passing again on the `4-0-stable` branch.