code: def custom_range(self, start_time, end_time=None):
          
          if end_time is None:
              end_time = current_millis()
          
          self.data.update(
              start_ms=start_time,
              end_ms=end_time)
          return self
docs: Provide a custom range for the search query. Start time and end
          time are expected to be naive ``datetime`` objects converted to 
          milliseconds. When submitting the query, it is strongly recommended
          to set the timezone matching the local client making the query.
          
          Example of finding all records on 9/2/2017 from 06:25:30 to 06:26:30
          in the local time zone CST::
          
              dt_start = datetime(2017, 9, 2, 6, 25, 30, 0)
              dt_end = datetime(2017, 9, 2, 6, 26, 30, 0)
      
              query = LogQuery()
              query.format.timezone('CST')
              query.time_range.custom_range(
                  datetime_to_ms(dt_start),
                  datetime_to_ms(dt_end))
              
              for record in query.fetch_batch():
                  print(record)
                  
          Last two minutes from current (py2)::
          
              now = datetime.now()
              start_time = int((now - timedelta(minutes=2)).strftime('%s'))*1000
          
          Specific start time (py2)::
          
              p2time = datetime.strptime("1.8.2017 08:26:42,76", "%d.%m.%Y %H:%M:%S,%f").strftime('%s')
              p2time = int(s)*1000
              
          Specific start time (py3)::
          
              p3time = datetime.strptime("1.8.2017 08:40:42,76", "%d.%m.%Y %H:%M:%S,%f")
              p3time.timestamp() * 1000
          
          :param int start_time: search start time in milliseconds. Start time
              represents the oldest timestamp.
          :param int end_time: search end time in milliseconds. End time
              represents the newest timestamp.