[WIP] Fix duplicate date functions. Implements #10220

Do not merge. Pending feedback on solution.

@MorrisJobke 
I <3 Jenkins.

What's the best assertion to have here? Maybe try a couple and use different timezones?