datetime and date format serialization