Restrict special datetime handling to parts of messages

This is an alternate implementation of #826.
That whole module is deprecated. I did the minimum work required to keep the tests passing.