Fixed a bug with varying datetime formats