Restrict special datetime handling to parts of messages

This is an alternate implementation of #826.
Should this not be just ``[msg.to_json() for msg in msgs]``?