Implemented datetime serialization