English

## Timing question

 13130 WHRoeder 2014.12.01 14:22 #   You could use TimeHour and minute but it's easier to just to keep it a unit.```#define HR2400 (PERIOD_D1 * 60)  // 86400 = 24 * 3600 int      TimeOfDay(datetime when=0){      if(when == 0)  when = TimeCurrent();                                           return( when % HR2400 );            } datetime DateOfDay(datetime when=0){      if(when == 0)  when = TimeCurrent();                                           return( when - TimeOfDay(when) );   } //datetime Tomorrow( datetime when=0){      if(when == 0)  when = TimeCurrent(); //                                          return(DateOfDay(when) + HR2400);   } //datetime Yesterday(datetime when=0){      if(when == 0)  when = TimeCurrent(); //   int iD1 = iBarShift(NULL, PERIOD_D1, DateOfDay(when) - 1); //                                       return( iTime(NULL, PERIOD_D1, iD1) ); } const int AM0945 = 35100; // ( 9 * 60 + 45) * 60 const int AM1145 = 42300; // (11 * 60 + 45) * 60 int now = TimeOfDay(); if(AM0945 <= now && now < AM1145) ...```