Check the change of Day

 
has anyone found a easy way to check when the day changes. On MT4 I used the simple code attached. Is there an equally simple way to do it in MT5 please.
  if (DayOfYear() != OldDayOfYear)
   {
    OldDayOfYear = DayOfYear();
 
BigAl:
has anyone found a easy way to check when the day changes. On MT4 I used the simple code attached. Is there an equally simple way to do it in MT5 please.

You could do something like this . . .

MqlDateTime StrucNow;

TimeToStruct(TimeCurrent(), StrucNow);

if (StrucNow.day_of_year != OldDayOfYear)
   {
    
   OldDayOfYear = StrucNow.day_of_year;
   }

 MqlDateTime

 
RaptorUK:

You could do something like this . . .

 MqlDateTime

just the ticket. thanks
Reason: