Libraries: ConvertServerTime - page 4

 
Fixed in v1.20:
int GetDST(const datetime aTime, const int baseUTC, const ENUM_RULE_DST aRule = DST_NONE)
  {
   if(aRule == DST_EU)
     {
      dst_start = MakeDateTime(iYear, 03, 31 - (4 + Y) % 7, 01) + baseUTC;  // the last Sunday of March for the EU switch (DST+1)
      dst_end   = MakeDateTime(iYear, 10, 31 - (1 + Y) % 7, 02) + baseUTC;  // the last Sunday of October for the EU switch (DST+0)
     }

   if(aRule == DST_US)
     {
      dst_start = MakeDateTime(iYear, 03, 14 - (1 + Y) % 7, 07) + baseUTC;  // the second Sunday of March for the US switch (DST+1)
      dst_end   = MakeDateTime(iYear, 11, 07 - (1 + Y) % 7, 07) + baseUTC;  // the first Sunday of November for the US switch (DST+0)
     }
  }
Using UTC hour for DST switch, then add baseUTC offset of broker's server.
Works nicely with european and US-scheduling servers.