Issue #20220: Merge time zone workaround from 3.4 into 3.5