'Convert a `datetime` object to a string representation (which will be
stored in MongoDB). This is the reverse function of
`_convert_from_string`.
>>> a = datetime(2011, 6, 8, 20, 26, 24, 92284)
>>> ComplexDateTimeField()._convert_from_datetime(a)
\'2011,06,08,20,26,24,092284\''

def _convert_from_datetime(self, val):

    return val.strftime(self.format)
