Py2 doesn't supports timestamp()

def _datetime_to_timestamp(self, v):
        """
        Py2 doesn't supports timestamp()
        """

        # stole from https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp
        if timezone.is_aware(v):
            return (v - timezone.datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()
        else:
            return (v - timezone.datetime(1970, 1, 1)).total_seconds()