def time_as_index(self, times, use_first_samp=None, use_rounding=False):
        # Note: this entire class can be removed in 0.13 (proper method
        # will be inherited from TimeMixin)
        if use_first_samp is None:
            use_first_samp = False
        else:
            warn('use_first_samp is deprecated, add raw.first_samp manually '
                 'if first sample offset is required', DeprecationWarning)
        index = super(_BaseRaw, self).time_as_index(times, use_rounding)
        if use_first_samp:
            index -= self.first_samp
        return index
Convert time to indices
dataset/ETHPy150Open mne-tools/mne-python/mne/io/base.py/_BaseRaw.time_as_index