Fix bug in serialization of date times