Clean merge of fixed mysql datetime handling
no need to replicate string_to_datetime functionality