How to load a central time by an EA - page 2

 
The GMT offset calculation is clear for me, just not what I'm looking for. If different machines / brokers have a few seconds variations in their timestamps, then my data will get messed up.. That's why I'm looking to get the time from one source into multiple machines.
 
WHRoeder:
Or see my code for auto adjusting offset.

 datetime    now = TimeGMT();

What is  TimeGMT()   ???

Never found this function in the book 

Looks like function is not defined .... 

 
deVries:

What is  TimeGMT()   ???

Never found this function in the book 

Looks like function is not defined .... 

It's defined on the same page  . . .  it's not a standard function,  it's user defined.

datetime TimeGMT(datetime serverTime=0){            // Server time to GMT time.
    if (serverTime == 0)    serverTime = TimeCurrent();
    static datetime nextAutoUpdate;     if (serverTime >= nextAutoUpdate){
        nextAutoUpdate = serverTime + 7200;
        if (Srvr.To.UTC.Auto
        )if(IsDllsAllowed()){                               // Complained @ init
            int     srvrToUTC       = LocalTimeGMT() - TimeCurrent();
            double  nearestHalfHour = MathRound(srvrToUTC / 1800.);
            Srvr.To.UTC.Hours       = nearestHalfHour / 2.; // Update external
    }   }
    return (serverTime + Srvr.To.UTC.Hours*3600.);
}
 
RaptorUK:

It's defined on the same page  . . .  it's not a standard function,  it's user defined.



thanks looked in WHRea also  

//+------------------------------------------------------------------+
//| GMT Time                                                         |
//+------------------------------------------------------------------+
datetime TimeGMT(){ // TimeCurrent to GMT
    datetime    now = TimeCurrent();                // Under tester, TimeLocal
    if (Srvr.To.UTC.Auto && (!IsTesting()) )        // and TimeCurrent are equal
        Srvr.To.UTC.Hours = (LocalTimeGMT() - now +1800)/3600;
    return (now + Srvr.To.UTC.Hours*3600);
}
#import "kernel32.dll"
int  GetTimeZoneInformation(int& TZInfoArray[]);
#import
datetime LocalTimeGMT(){    // TimeLocal to GMT
    int TZInfoArray[43];
    int tz  = GetTimeZoneInformation(TZInfoArray);      #define DAYLIGHT 2
    int GMTshift    = TZInfoArray[0];   /* GetTimeZoneInformation will return
                                         * the right Bias even when it returns
                                         * UNKNOWN==0 */
    if(tz == DAYLIGHT)  GMTshift+=TZInfoArray[42];
    return (TimeLocal() + GMTshift*60);
}

now clear where it comes from that the function was purple colored like TimeCurrent() made me think it was defined in the standard coding

 
deVries: function was purple colored like ...
Change to the forum. "purple" is unread.