<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def serialize(self, value):
 """Takes a datetime object and returns a string"""

        if isinstance(value, str):
            return value
        return value.strftime(DATETIME_FORMAT)