datetime daytimes[];int shift=10,dayshift;// All the Time[] series are sorted in descendant modeArrayCopySeries(daytimes,MODE_TIME,Symbol(),PERIOD_D1);if(Time[shift]>=daytimes[0]) dayshift=0;else { dayshift=ArrayBsearch(daytimes,Time[shift],WHOLE_ARRAY,0,MODE_DESCEND);if(Period()<PERIOD_D1) dayshift++; }Print(TimeToStr(Time[shift])," corresponds to ",dayshift," day bar opened at ",TimeToStr(daytimes[dayshift]));