code: def cql_encode_datetime(self, val):
          
          timestamp = calendar.timegm(val.utctimetuple())
          return str(long(timestamp * 1e3 + getattr(val, 'microsecond', 0) / 1e3))
docs: Converts a :class:`datetime.datetime` object to a (string) integer timestamp
          with millisecond precision.