Clean merge of fixed mysql datetime handling