'A hook to control how datetimes are formatted.
Can be overridden at the ``Serializer`` level (``datetime_formatting``)
or globally (via ``settings.TASTYPIE_DATETIME_FORMATTING``).
Default is ``iso-8601``, which looks like "2010-12-16T03:02:14".'

def format_datetime(self, data):

    data = make_naive(data)
    if (self.datetime_formatting == u'rfc-2822'):
        return format_datetime(data)
    if (self.datetime_formatting == u'iso-8601-strict'):
        data = (data - datetime.timedelta(microseconds=data.microsecond))
    return data.isoformat()
