Updated this morning and TimeCurrent() doesn't work anymore

 

I used to do something like this to get the code to wait:

     if (TimeCurrent() > lastChecked+(60*15)){
         for (int i = 0; i < OrdersTotal(); i++){
            if (OrderSelect(i,SELECT_BY_POS) > 0){
                  if (OrderType() == OP_BUY){
                     if (OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),0,0)> 0){;}
                  }
                  if (OrderType() == OP_SELL){
                     if (OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),0,0) > 0){;}
                  }               
             }
          }
         lastChecked = TimeCurrent();   
     }

But after that last update it's no longer working. I did a print statement and it actually adjust for the time differences and prints it, but it no longer works.  It used to give an integer value and now it gives an actual date. It prints is correctly if I add integers, but the same method of waiting no longer works.

So, how am I supped to do this now?

 
Also the comment function returns an error of wrong type and won't comment. But the compiler doesn't and prints it correctly.. So I can compile it, print it, but the comments can't use it and the rest of the code can't use it.
 
PumPuiMonkey: It used to give an integer value and now it gives an actual date.
It used to give a datetime, still does. datetime and long are interchangeable. Only difference is what Print/Comment does with it.
datetime lastChecked;
 
I tried that. First thing I did. No effect.
 

The problem is obviously I'm trying to add integers to timedate. Not sure how to get around it. Where TimeCurrent used to be an integer.

And just to confuse me it prints correctly. When I print the result it does give the result I was excepting.

 
I think I had a logic problem....
Reason: