myextent[1]=mdates.date2num(dt.strptime(pt.taql('select str(mjdtodate({})) as date'.format(starttime+plottime/(24.*3600.))).getcol('date')[0],'%Y/%m/%d/%H:%M:%S'))# thanks to TJD
plottimestart=dt.strptime(pt.taql('select str(mjdtodate({})) as date'.format(time+(tmpdata.shape[0]*averagetime)/(24.*3600.)-plottime/(24.*3600.))).getcol('date')[0],'%Y/%m/%d/%H:%M:%S')
myextent[0]=mdates.date2num(plottimestart)
plottimeend=dt.strptime(pt.taql('select str(mjdtodate({})) as date'.format(time+(tmpdata.shape[0]*averagetime)/(24.*3600.))).getcol('date')[0],'%Y/%m/%d/%H:%M:%S')