'Shift time scale in evoked data.
Parameters
tshift : float
The amount of time shift to be applied if relative is True
else the first time point. When relative is True, positive value
of tshift moves the data forward while negative tshift moves it
backward.
relative : bool
If true, move the time backwards or forwards by specified amount.
Else, set the starting time point to the value of tshift.
Notes
Maximum accuracy of time shift is 1 / evoked.info[\'sfreq\']'

def shift_time(self, tshift, relative=True):

    times = self.times
    sfreq = self.info['sfreq']
    offset = (self.first if relative else 0)
    self.first = (int((tshift * sfreq)) + offset)
    self.last = ((self.first + len(times)) - 1)
    self.times = (np.arange(self.first, (self.last + 1), dtype=np.float) / sfreq)
