Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Local Time Zone and Local Session Time - MetaTrader 5 Library | MT5 EA Download - MetaTrader 5 Resources

author EAcpu | 5 reads | 0 comments |

Local Timezones and Local Session Hours - library for MetaTrader 5

Local Timezones and Local Session Hours - library for MetaTrader 5

Local Timezones and Local Session Hours - library for MetaTrader 5

Local Timezones and Local Session Hours - library for MetaTrader 5

Local Timezones and Local Session Hours - library for MetaTrader 5

Local Timezones and Local Session Hours - library for MetaTrader 5

Local Timezones and Local Session Hours - library for MetaTrader 5

Local Timezones and Local Session Hours - library for MetaTrader 5

Hello traders.

This library has all the functionality to get the current local time for a specific or all Forex markets. You can convert local time between time zones to your broker's server time. You can also place trades within a specific session by setting the session start and end time for each session individually. The library will handle the different time offsets and daylight saving time changes of brokers and these markets. This relieves you of the burden of reinventing the wheel every time you write an Expert Advisor or technical indicator that has to deal with time zones and local session times.

A time zone is defined as a standard time based on the geographic representation of that location. In other words, a time zone refers to the local time in a specific region based on the Earth's rotation. It is defined in UTC (Coordinated Universal Time), the standard for coordinating time in various regions of the world.

For example - New York time is 5 hours behind Greenwich Mean Time, expressed as UTC-5 or UTC-4 depending on daylight. Sydney time is 10 hours ahead of Greenwich Mean Time and is expressed as UTC+10 or UTC+11 depending on daylight (summer or winter). The terms UTC and GMT are often used interchangeably to refer to offsets, so UTC+2 and often GMT+2 have the same meaning.

If the time zone is east of GMT, the UTC offset is positive; if the time zone is west of GMT, the UTC offset is negative.

Local Timezones and Local Session Hours - library for MetaTrader 5

 //+------------------------------------------------------------------+
//|Time zone identifier |
//+------------------------------------------------------------------+
Enum ENUM_ZONE_ID
  {
  ZONE_ID_SYDNEY, // Sydney ZONE_ID_TOKYO, // Tokyo ZONE_ID_FRANKFURT, // Frankfurt ZONE_ID_LONDON, // London ZONE_ID_NEWYORK, // New York ZONE_ID_UTC, // UTC ZONE_ID_LOCAL, // Local ZONE_ID_BROKER, // Broker ZONE_ID_CUSTOM // Custom };
//+------------------------------------------------------------------+
//| CTimeZoneInfo class.                                            |
//|Purpose: Class obtains the specified local time| |
//| Location and time zone information, time |
//| Changes for the current year.                          |
//| |
//|Offset notation used in the library: |
//| Please note that the library indicates positive time |
//| Positive offset zone and negative time zone |
//| By negative offset.                                    |
//| In contrast, MQL5's built-in TimeGMTOffset() |
//| function represents positive time zone, such as GMT+3, |
//| Negative offset, such as -10800, or vice versa.    |
//+------------------------------------------------------------------+
Class C Time Zone Information { Public :
                    CTimeZoneInfo( ENUM_ZONE_ID placeId, date time pLocalTime = TIME_NOW );
                    ~CTimeZoneInfo( blank );

string name ( blank ); // Return time zone name string to string ( boolean seconds = true , boolean zname = true ); // Return local time string boolean formatted with TZ/DST offset and tzname refresh time ( blank ); // Refresh the current local time and fill in the time zone information boolean set local time ( datetime pLocalTime = TIME_NOW); // Sets the local time at this location to the specified time date time local ( blank ); // Returns the local time date time in the time zone UTC ( blank ); // Returns the UTC time (same for all time zones) as an integer time GMT offset ( blank ); // Positive for a positive time zone (e.g., GMT+3), negative otherwise. (includes daylight saving time) integer time daylight saving time ( blank ); // Returns the DST correction (in seconds) for the set local time time zone. Date and time ConvertLocalTime( ENUM_ZONE_ID Destination Id ); // Convert the local time of this time zone to the local time of other time zones Boolean value Get the daylight switching time ( date time &dst_start, date time &dst_end); // Get the start and end time date and time of daylight saving time of the current year Get the daylight next switch ( blank ); // Get the local time of the next daylight saving time switch blank Print object ( blank );

//--- Static methods that do not require object creation. Stationary Date Time GetCurrentTimeForPlace ( ENUM_ZONE_ID LocationId ); // Get the current local time in the specified time zone Stationary String Place Format Time ( DateTimeTime , ENUM_ZONE_ID LocationId, Boolean Seconds = True , Boolean Name = True );
Stationary date and time convert time to location ( date time and time, ENUM_ZONE_ID location Id, ENUM_ZONE_ID destination Id);
Stationary integer time GMT offset (ENUM_ZONE_ID location ID, date time time = TIME_NOW); // returnThe total tz offset (UTC+DST) of the time zone relative to GMT for the given local time is the integer time daylight saving time at rest (ENUM_ZONE_ID place ID, date time time = TIME_NOW); // Returns the daylight saving time correction (in seconds) for the time zone given local time at rest Boolean IsDaylightSavingTime (ENUM_ZONE_ID placeId, date time time = TIME_NOW); // Check whether the specified time belongs to daylight saving time . The Boolean value of the stationary GetDaylightSwitchTimes (ENUM_ZONE_ID placeId, integer my year, datetime &dst_start, datetime &dst_end); the stationary Boolean value of GetDaylightSwitchDeltas(ENUM_ZONE_ID placeId, integer my year, integer &delta_start, integer &delta_end); static boolean set custom time zone ( thin name, integer baseGMT offset = 0 , // Defines a time zone not found in the library. ENUM_ZONE_ID dstSchedule = ZONE_ID_UTC); static boolean set custom time zone using GoldSymbol ( boolean enable= True ); // Set option to use golden symbols to estimate server TZ/DST };


//+------------------------------------------------------------------+
//| CSessionHours class.                                            |
//|Purpose: Class to access local trading hours|
//| Specify the location.                                |
//| Derived from class CTimeZoneInfo.                      |
//|Note: The default session time is set to 8:00 AM to 5:00 PM |
//| The local time of the new CSessionHours object.              |
//+------------------------------------------------------------------+
class CSessionHours: public C time zone information { public :
                    CSessionHours( ENUM_ZONE_ID placeId );
                    ~CSessionHours( blank );

//--- Method to access local session time Boolean value refresh time ( blank ); // Refresh the current local time and the current day's session time Boolean value Set local time ( date time p local time);

//--- Methods to override the default local session time boolean start local time( integer hours , integer p minutes); // Set the local session start time using start hours and minutes boolean end local time( integer hours , integer p minutes); // Set the local session end time using end hours and minutes //--- Methods to access the local session time datetime start localtime( blank );
datetime end local time( blank );
boolean Check local session ( blank ); // Check if the local trading session is currently active. integer seconds remaining session ( blank ); // The remaining time (in seconds) until the local session is closed for the day. //--- Static methods that do not require object creation. Still date and time Foreign exchange closing time ( blank ); // Broker time when the foreign exchange market is closed this week. static integer Number of Forex seconds remaining ( blank ); // Time remaining in seconds for the Forex market closing this week.  };


Note that the library says time zone Positive offset, negative time zone and negative offset.

This is contrary to MQL5's built-in TimeGMTOffset() function, which represents a positive time zone (eg GMT+3) with a negative offset (eg -10800) and vice versa.

By default, the library will search for and load the XAUUSD symbol to estimate the server's time zone offset. During periods when the US DST and EU DST schedules are out of sync (March and late October), XAUUSD can provide more reliable results (especially for brokers following the EU DST schedule). Alternatively, if your broker follows the US DST schedule, or has no schedule at all, then using chart symbols will work too. Call CTimeZoneInfo::SetUsingGoldSymbol() with "false" to use the current chart's symbol instead of XAUUSD.

To determine a broker's Daylight Saving Time (DST) schedule, you can use this script https://www.mql5.com/en/code/48650

 //+------------------------------------------------------------------+
//|Set the option to use the XAUUSD (gold) symbol to estimate |
//|Determine the server's TZ/DST by analyzing H1 quote history.                |
//| TRUE: Search and load gold symbols (default behavior).      |
//| FALSE: Use the symbol of the current chart.                    |
//+------------------------------------------------------------------+
void CTimeZoneInfo::SetUsingGoldSymbol( const boolean enabled= true );

notes :

As a side effect of XAUUSD starting one hour after Forex trading, the daylight saving time switch will happen an hour later (only in the strategy tester, not in normal mode).

During testing in the strategy tester, timeGMT() always equal to time trading server() Simulate server time.

The TimeZoneInfo library estimates the correct time for a time zone based on "real" GMT by analyzing H1 quote history, rather than based on the time returned by calling the built-in TimeGMT function.

If the XAUUSD symbol is used to estimate the TZ/DST of the server, the dst switch will occur after one hour in the strategy tester.

this refreshtime() Method will update the time zone for the current local time. Let's look at an example to show how to get the current time.

Print ( "\n========== Get the current time in the time zone ===========" );

  CTimeZoneInfo tz(ZONE_ID_TOKYO);
  tz.RefreshTime(); // Fill in the current time zone information and print ( "Name(): " , tz.Name());
print ( "TimeLocal():" , here.TimeLocal ());
print ( "ToString():" , tz.ToString());

Output :

 // ========== Get the current time in the time zone ========== // Name() : Tokyo // TimeLocal() : 2024.02.28 19:58:50 // ToString() : Wednesday, February 28, 2024 19:58:50 GMT+9 [Tokyo]


Do you need more information?

 print ("\n========== More information about time zones===========");

  CTimeZoneInfo tz(ZONE_ID_NEWYORK);
  tz.RefreshTime();

Print ("Name() : ", tz.Name());
print ("TimeUTC() : ", tz.TimeUTC());
print (" timelocal ():", hereby.timelocal ());
print (" TimeGMTOffset ():", hereby. TimeGMTOffset ());
print (" TimeDaylight Saving Time (): ", here. Time Daylight Saving Time ());
Print ("ToString() : ", tz.ToString());
Date and time target start, target end;
  tz.GetDaylightSwitchTimes(dst_start, dst_end);
print ("dst_start : ", dst_start);
print ("dst_end : ", dst_end);
Print ("GetDaylightNextSwitch() : ", tz.GetDaylightNextSwitch());

Output:

 // ========== More information about time zones ========== // Name() : New York // TimeUTC() : 2024.03.17 16:50:38 // TimeLocal() : 2024.03.17 12:50:38 // TimeGMTOffset() : -14400 // TimeDaylightSavings() : 3600 // ToString() : Sunday, 17 March 2024 12:50:38 GMT-4 [New York] (Daylight Savings Time) // dst_start : 2024.03.10 02:00:00 // dst_end : 2024.11.03 02:00:00 // Get DaylightNextSwitch() : 2024.11.03 02:00:00

notes:

- The time UTC() method returns UTC time, which is equivalent to GMT time.

- The timelocal() method returns the local time for that time zone (which may change by calling the refreshtime or setlocaltime methods).

- The timeGMTOffset() method returns the current difference (in seconds) between local time and GMT time for this time zone, taking into account switches to winter or summer time. The offset returned includes the DST adjustment for the current time zone. If the time zone is east of (earlier than) GMT, the GMT offset is positive; if the time zone is west of (later than) GMT, the GMT offset is negative.

-timeDaylightSaving() method returns the daylight saving time (DST) adjustment in seconds if the area has switched to daylight saving time in a region where DST is in effect. Returns 0 if the time zone has been switched to winter (standard) time (or if the time zone does not support DST). The dst adjustment is already part of TimeGMTOffset.

The CTimeZoneInfo class includes the Set Custom Time Zone method, which you can use to configure the built-in custom time zone. Later, a custom time zone can be used via the ZONE_ID_CUSTOM identifier. Let's look at an example that shows how to configure a built-in custom time zone to specify a name, an offset from Greenwich Mean Time (GMT), and a daylight saving time identifier.

 Print ( "\n========== Configure built-in custom time zone ==========" );

string name = "custom+3" ; // Custom time zone name integer Base GMT offset = 10800 ; // Custom time zone's base GMT offset in seconds ENUM_ZONE_ID daylightRuleId = ZONE_ID_LONDON; // Custom time zone's DST schedule boolean success = CTimeZoneInfo::SetCustomTimeZone(name, baseGMTOffset, daylightRuleId);

print ( "Parameter 'name':" , name);
print ( "Parameter 'baseGMTOffset':" , base GMT offset);
Print ( "Parameter 'daylightRuleId':" , enumeration to string (daylight rule ID));
print ( "SetCustomTimeZone() returned: " , success);

Output:

// ========== Configure built-in custom time zone ========== // Parameter 'name' : Custom+3 // Parameter "baseGMTOffset": 10800 // Parameter "daylightRuleId": ZONE_ID_LONDON // SetCustomTimeZone() returns: true


Let's see an example to show how to get the current local time for all time zones.

 Print ( "\n========== Get the current time in all time zones ===========" );

for (ENUM_ZONE_ID ID= 0 ; id <= MAX_ZONE_ID; id++)
    {
      CTimeZoneInfo tz(id);
      tz.RefreshTime();

Print format ( "%-12s: %s | %s" , tz.Name(), string time (tz. time local ()), tz.ToString());
    }

Output:

 // ========== Get the current time for all time zones ========== // Sydney : 2024.02.28 21:58 | Wednesday, February 28, 2024 21:58:50 GMT+11 [Sydney] (Daylight Saving Time) // Tokyo : 2024.02.28 19:58 | Wednesday, February 28, 2024 19:58:50 GMT+9 [Tokyo] // Frankfurt : 2024.02.28 11:58 | Wednesday, February 28, 2024 11:58:50 GMT+1 [Frankfurt] // London : 2024.02.28 10:58 | Wednesday, February 28, 2024 10:58:50 GMT+0 [London] // New York : 2024.02.28 05:58 | Wednesday, February 28, 2024 05:58:50 GMT-5 [New York] // UTC : 2024.02.28 10:58 | Wednesday, February 28, 2024 10:58:50 GMT+0 [UTC] // Home : 2024.02.28 12:58 | Wednesday, February 28, 2024 12:58:50 GMT+2 [Home] // FXOpen-MT5 : 2024.02.28 12:58 | Wednesday, February 28, 2024 12:58:50 GMT+2 [FXOpen-MT5]


This can be done in other ways using the static method GetCurrentPlaceTime () . Also, please note that there is another static method formattimeaslocation () that can be used to format pure mql datetime variables into strings (Similar to string time ) but contains the weekday, date, time, time zone name, and offset. These static methods do not require object creation to call them.

 print ( "\n========== GetCurrentTimeForPlace() ============" );

for (ENUM_ZONE_ID ID = 0 ; id <= MAX_ZONE_ID; id++)
    {
DateTimeTime = CTimeZoneInfo::GetCurrentTimeForPlace(id);

Print format ( "Time: %s | %s" , string time (time), CTimeZoneInfo::FormatTimeForPlace(time, id));
    }

Output :

 // ========== GetCurrentTimeForPlace() ========== // Time: 2024.02.28 21:58 | Wednesday, February 28, 2024 21:58:50 GMT+11 [Sydney] (Daylight Saving Time) // Time: 2024.02.28 19:58 | February 28, 2024 Wednesday 2024.02.28 19:58:50 GMT+9 [Tokyo] // Time: 2024.02.28 11:58 | Wednesday 28 February 2024 11:58:50 GMT+1 [Frankfurt] // Time: 2024.02.28 10:58 | Wednesday 28 February 2024 10:58:50 GMT+0 [London] // Time : 2024.02.28 05:58 | Wednesday, February 28, 2024 05:58:50 GMT-5 [New York] // Time : 2024.02.28 10:58 | Wednesday, February 28, 2024 10:58:50 GMT+0 [UTC] // Time : 2024.02.28 12:58 | Wednesday, February 28, 2024 12:58:50 GMT+2 [Home] // Time: 2024.02.28 12:58 | Wednesday, February 28, 2024 12:58:50 GMT+2 [FXOpen-MT5]


this set local time() method will set Specify local time . Let's look at an example to show how to set the local time for a time zone.

Print ( "\n========== Set the local time of the time zone ===========" );

  CTimeZoneInfo tz(ZONE_ID_NEWYORK);

if (tz.set local time ( D'2021.07.15 09:31' ))
Print format ( "%-12s: %s | %s" , tz.Name(), string time (tz. time local ()), tz.ToString());

if (tz.set local time ( D'2022.01.23 17:04' ))
Print format ( "%-12s: %s | %s" , tz.Name(), string time (tz. time local ()), tz.ToString());

if (tz.set local time ( D'2023.03.12 02:21' ))
Print format ( "%-12s: %s | %s" , tz.Name(), string time (tz. time local ()), tz.ToString());

Output:

 // ========== Set local time for time zone ========== // New York : 2021.07.15 09:31 | Thursday, July 15, 2021 09:31:00 GMT-4 [New York] (Daylight Saving Time) // New York : 2022.01.23 17:04 | Sunday, January 23, 2022 17:04:00 GMT-5 [New York] // >> Error: Time 2023.03.12 02:21 does not exist in New York. This is because Daylight Saving Time skips an hour.

The reason for the last error message we received is explained in the next paragraph.

DST is a seasonal time change measure in which clocks are set earlier than standard time during part of the year.

See https://www.timeanddate.com/time/dst/transition.html

("Summer's Skip", "Winter's Return")

When Daylight Saving Time begins in the spring, our clocks advance a certain amount of time, usually one hour. This means an hour skipped on the clock. In the fall, daylight saving time typically ends and our clocks are set back to standard time again.

(time that does not exist)

In the United States, DST always starts at 02:00 local time (2 am). When the time first reaches 1:59:59 Standard Time, the clock will jump forward to 3:00:00 Daylight Saving Time. Therefore, the period from 2:00:00 to 2:59:59 does not exist on the switching night.

Local Timezones and Local Session Hours - library for MetaTrader 5

Let's look at an example showing how to get the time zone name, UTC offset, and current DST offset (if DST is in effect).

 print ( "\n========== UTC offset and current DST offset ===========" );

for (ENUM_ZONE_ID ID = 0 ; id <= MAX_ZONE_ID; id++)
    {
      CTimeZoneInfo tz(id);
      tz.RefreshTime(); // Fill in the current time zone information printing format ( "%-12s: GMT%+g | DST%+g" , tz.Name(), tz.Time GMT offset ()/ 3600 ., tz.Time daylight saving time ()/ 3600 .);
    }

Output:

 // ========== UTC offset and current DST offset ========== // Sydney : GMT+11 | DST +1 // Tokyo : GMT+9 | DST+0 // Frankfurt : GMT+1 | DST+0 // London : GMT+0 | DST+0 // New York : GMT-4 | DST+1 // UTC : GMT+0 | DST+0 // Home : GMT+2 |Daylight Saving Time+0 // FXOpen-MT5 : GMT+2 |Daylight Saving Time+0

notes:

- The timeGMTOffset() method returns the current difference (in seconds) between local time and GMT time for this time zone, taking into account switches to winter or summer time. The offset returned includes the DST adjustment for the current time zone. If the time zone is east of (earlier than) GMT, the GMT offset is positive; if the time zone is west of (later than) GMT, the GMT offset is negative.

- timedaylight saving time() If the region has switched to daylight saving time in a region where DST is in effect, the method returns the daylight saving time (DST) adjustment in seconds. Returns 0 if the time zone has been switched to winter (standard) time (or if the time zone does not support DST). The dst adjustment is already part of TimeGMTOffset.

Let's look at an example to show how to get DST information.

Print ( "\n========== Daylight Saving Time Switching Time of the Year ===========" );

Date and time target start, target end;

for (ENUM_ZONE_ID ID = 0 ; id <= MAX_ZONE_ID; id++)
    {
      CTimeZoneInfo tz(id);
      tz.RefreshTime(); // Fill in the current time zone information //--- Only applicable to time zones that observe daylight saving time. if (tz.GetDaylightSwitchTimes(dst_start, dst_end))
        {
Print format ( "%-12s: Daylight saving time starts at %s | Daylight saving time ends at %s" , tz.Name(), string time (target start), string time (dst_end));
        }
    }

Output:

 // ========== Daylight saving time switch time of the current year ========== // Sydney: Daylight saving time starts at 03:00 on April 7, 2024 | Daylight saving time ends on 2024.10.06 02:00 // Frankfurt: Daylight saving time starts at 02:00 on March 31, 2024 | Daylight saving time on 2024.10.27 Ends at 03:00 // London : Daylight saving time starts at 01:00 on March 31, 2024 | Ends at 2024.10.27 02:00 // New York : Daylight saving time starts at 02:00 on March 10, 2024 | Ends at 2024.11.03 02:00

3. Next daylight saving time switching time

Let's look at an example to show how to get the time of the next daylight saving time switch.

 Print ( "\n========== Next daylight saving time switching time ==========" );

for (ENUM_ZONE_ID ID= 0 ; id <= MAX_ZONE_ID; id++)
    {
      CTimeZoneInfo tz(id);
      tz.RefreshTime();

Date and time nxswitch = tz.GetDaylightNextSwitch();

//--- Applies only to time zones that observe daylight saving time. if (nx switch)
        {
Print format ( "%-12s: time: %s | dstNextSwitch: %s" , tz.Name(), string time (z. time local ()), string time (nx switch));
        }
    }

Output:

 // ========== Next daylight saving time switch time ========== // Sydney : Time: 2024.02.28 21:58 | dstNextSwitch: 2024.04.07 03:00 // Frankfurt : Time: 2024.02.28 11:58 | dstNextSwitch: 2024.03.31 02:00 // London : Time: 2024.02.28 10:58 | dstNextSwitch: 2024.03.31 01:00 // New York : Time: 2024.02.28 05:58 | dstNextSwitch: 2024.03.10 02:00


Let's look at an example showing how to get DST information for all time zones in this library over the years.

 print ( "\n========== Daylight Saving Time List==========" );

Date and time target start, target end;
Integer increment start, increment end; // Clock change (in seconds) for (ENUM_ZONE_ID ID = 0 ; id <= MAX_ZONE_ID; id++)
    {
      CTimeZoneInfo time zone(id);

Print format ( “========== %s Daylight Saving Time (DST) ========== , timezone.Name());
for ( integer year = 2008 ; year <= 2030 ; year++)
        {
//--- Applies only to time zones that observe daylight saving time. if (CTimeZoneInfo::GetDaylightSwitchTimes(id, year, dst_start, dst_end))
          {
            CTimeZoneInfo::GetDaylightSwitchDeltas(id, year, delta_start, delta_end);

Print format ( "Daylight saving time starts at %s (%+d) and ends at %s (%+d)" , string time (dst_start), delta_start/ 3600 , string time (dst_end), delta_end/ 3600 );
          }
        }

    }

Output:

// ========== Daylight Saving Time List ========== // ========= Sydney Daylight Saving Time (DST) ========= // DST starts on 2008.04.06 03:00 (-1) and ends on 2008.10.05 02:00 (+1) // DST starts on 2009.04.05 03:00 (-1) Ends at 2009.10.04 02:00 (+1) // Daylight saving time starts at 2010.04.04 03:00 (-1) Ends at 2010.10.03 02:00 (+1) // DST starts at 2011.04.03 03:00 (-1) Ends at 2011.10.02 02:00 (+1) // DST starts at 2012.04.01 03:00 (-1) ends at 2012.10.07 02:00 (+1) // ... // ... // ...

5. Server GMT offset (current)

The broker's GMT offset indicates how many seconds the broker's time is ahead of GMT, broker offset = TimeTradeServer() - TimeGMT(). A positive value means the server time is ahead of GMT. Let's look at an example to show how to get the current GMT offset of a broker.

 Print ( "\n========== Broker's current GMT offset========== " );

  CTimeZoneInfo broker(ZONE_ID_BROKER);
  Broker.RefreshTime();

print ( "Name():" , broker.Name());
print ( "TimeLocal():" , Broker.TimeLocal ()); // BrokerTimePrint ( "ToString():" , Broker.ToString());
print ( "TimeGMT Offset():" , broker. TimeGMTOffset ());

Output:

 // ========== Broker's current GMT offset ========== // Name() : ICMarketsSC-Demo // TimeLocal() : 2024.03.08 06:33:06 // ToString() : Friday, March 08, 2024 06:33:06 GMT+2 [ICMarketsSC-Demo] // GMT Offset() : 7200

Notes: An important note about timeGMToffset() is that it will return the UTC offset, including daylight saving time corrections (UTC+DST). Positive values ​​mean the server time is ahead of GMT (Eastern).

A server's past GMT offset can be calculated as the difference between the time of the first bar of the server week on the chart and the UTC time corresponding to 5 PM on Sunday, New York time . Let's look at an example showing how to get a broker's past GMT offset. In this example, we will use the time of the chart candle as the broker's elapsed time.

 print ( "\n========== Broker's past GMT offset (candlestick) ============ );

datetimebareras [];
integer copy = copyTime ( symbol (), PERIOD_D1 , D'2022.03.18' , 9 , barTime);
if (copied <= 0 )
print ( "CopyTime() failed." );

for ( integer i = 0 ; i < copy; i++)
    {
Date time t = bartimes[i];

      CTimeZoneInfo broker(ZONE_ID_BROKER);
      Broker.SetLocalTime(t);

Print format ( "Column #%i Time: %s | Offset: %5d (GMT%+g) | %s" ,
                  Me + 1 ,
String time ( broker.timelocal ()),
                  broker. Time GMT offset (),
                  broker. Time GMT offset ()/ 3600.0 ,
                  Broker.ToString());
    }

Output:

// ========== Broker's past GMT offset (candles) ========== // Bar #1 Time: 2022.03.08 00:00 | Offset: 7200 (GMT+2) | Tuesday, March 08, 2022 00:00:00 GMT+2 [ICMarketsSC-Demo] // Bar #2 Time: 2022.03.09 00:00 | Offset: 7200 (GMT+2) | Wednesday, March 09, 2022 00:00:00 GMT+2 [ICMarketsSC-Demo] // #3 Column Time: 2022.03.10 00:00 | Offset: 7200 (GMT+2) | March 10, 2022 Thursday, March 11 00:00:00 GMT+2 [ICMarketsSC-Demo] // Column #4 Time: 2022.03.11 00:00 | Offset: 7200 (GMT+2) | Friday, March 11, 2022 00:00:00 GMT+2 [ICMarketsSC-Demo] // Column #5 Time: 2022.03.14 00:00 | Offset: 10800 (GMT+3) | Monday, March 14, 2022 00:00:00 GMT+3 [ICMarketsSC-Demo] // #6 Column Time: 2022.03.15 00:00 | Offset: 10800 (GMT+3) | Tuesday, March 15, 2022 00:00:00 GMT+3 [ICMarketsSC-Demo] // #7 Bar Time: 2022.03.16 00:00 | Offset: 10800 (GMT+3) | Wednesday, March 16, 2022 00:00:00 GMT+3 [ICMarketsSC-Demo] // #8 Bar Time: 2022.03.17 00:00 | Offset: 10800 (GMT+3) | Thursday, March 17, 2022 00:00:00 GMT+3 [ICMarketsSC-Demo] // #9 Time: 2022.03.18 00:00 | Offset: 10800 (GMT+3) | Friday, March 18, 2022 00:00:00 GMT+3 [ICMarketsSC-Demo]

As you can see in bar #5, the server has switched from +2 winter time to +3 daylight saving time, following the US daylight saving time schedule (the second Sunday in March). There are five D1 candles every week , with no candles lit on Saturdays and Sundays. The time on these servers is always 7 hours ahead of New York throughout the year and is expressed as NY+7. Note that New York is -5 in winter and -4 in summer .

This is the first library on the code base that is able to determine a server's past GMT offset (historical GMT offset). The algorithm implemented in the calculation is very fast and accurate and is as compatible as possible with different brokers (tested on a large number of brokers with different GMT offsets or DST schedules).

Use the ConvertLocalTime() method to convert this zone instance's set local time to a specific time zone. This method returns the new time for the given time zone.

Let's look at an example to show how to convert the " current " local time to a specific time zone.

 print ( "\n========== Convert the current local time in Sydney to New York ===========" );

  CTimeZoneInfo Sydney(ZONE_ID_SYDNEY);
  Sydney.RefreshTime();

datetime localtime = sydney. timelocal ();
Date time conversion = sydney.ConvertLocalTime(ZONE_ID_NEWYORK);

Print format ( "%s | %s" , string time (local time), sydney.ToString());
Print format ( "%s | %s" , string time (conversion), CTimeZoneInfo::FormatTimeForPlace (conversion, ZONE_ID_NEWYORK));

Output:

 // ========== Convert current local time in Sydney to New York ========== // 2024.02.28 21:58 | Wednesday, 28 February 2024 21:58:50 GMT+11 [Sydney] (Daylight Saving Time) // 2024.02.28 05:58 | Wednesday, 28 February 2024 05:58:50 GMT-5 [New York]


Let's see an example to show how to convert a specific local time to a specific time zone.

 Print ( "\n========== Convert Sydney specific local time to New York ===========" );

  CTimeZoneInfo Sydney(ZONE_ID_SYDNEY);
  Sydney.SetLocalTime( D'2016.05.21 14:47:08' );

datetime localtime = sydney. timelocal ();
Date time conversion = sydney.ConvertLocalTime(ZONE_ID_NEWYORK);

Print format ( "%s | %s" , string time (local time), sydney.ToString());
Print format ( "%s | %s" , string time (conversion), CTimeZoneInfo::FormatTimeForPlace (conversion, ZONE_ID_NEWYORK));

Output:

 // ========== Convert specific local time in Sydney to New York ========== // 2016.05.21 14:47 | Saturday, May 21, 2016 14:47:08 GMT+10 [Sydney] // 2016.05.21 00:47 | Saturday, May 21, 2016 00:47:08 GMT-4 [New York] (Daylight Saving Time)


Let's look at an example to show how to convert the current local time to proxy time for all time zones.

print ( "\n========== Convert current local time to broker time in all time zones ==========" );

for (ENUM_ZONE_ID ID = 0 ; id <= MAX_ZONE_ID; id++)
    {
Date time local time = CTimeZoneInfo::GetCurrentTimeForPlace(id);
Date and time conversion = CTimeZoneInfo::ConvertTimeForPlace(localtime, id, ZONE_ID_BROKER);

Print format ( “%-49s | %s” , CTimeZoneInfo::FormatTimeForPlace(localtime, id), CTimeZoneInfo::FormatTimeForPlace(converted, ZONE_ID_BROKER));
    }

Output:

 // ========== Convert current local time to proxy time for all time zones ========== // Wednesday, 28 February 2024 21:58:50 GMT+11 [Sydney] (daylight saving time) | Wednesday 28 February 2024, 12:58:50 GMT+2 [FXOpen-MT5] // Wednesday, 28 February 2024 19:58:50 GMT+9 [Tokyo] | Wednesday, February 28, 2024 12:58:50 GMT+2 [FXOpen-MT5] // Wednesday, February 28, 2024 11:58:50 GMT+1 [Frankfurt] | Wednesday, February 28, 2024 12:58:50 GMT+2 [FXOpen-MT5] // Wednesday, February 28, 2024 Wednesday, 28 February 2024 10:58:50 GMT+0 [London] | Wednesday, 28 February 2024 12:58:50 GMT+2 [FXOpen-MT5] // Wednesday, 28 February 2024 05:58:50 GMT-5 [New York] | Wednesday 28 February 2024, 12:58:50 GMT+2 [FXOpen-MT5] // 2 Wednesday, February 28, 2024 10:58:50 GMT+0 [UTC] | Wednesday, February 28, 2024 12:58:50 GMT+2 [FXOpen-MT5] // Wednesday, February 28, 2024 12:58:50 GMT+2 [Home] | Wednesday, February 28, 2024 12:58:50 GMT+2 [FXOpen-MT5] // Wednesday, February 28, 2024 12:58:50 GMT+2 [FXOpen-MT5] | Wednesday, February 28, 2024 12:58:50 GMT+2 [FXOpen-MT5]


Note that using the parent C time zone information class, rather than the C session time class, is not preferred as it requires more coding and is therefore error prone. Let’s look at an example to show how to get Forex trading times for all time zones and convert them to broker’s time.

print ( "\n======== Local session time (CTimeZoneInfo class)=======" );

Constant ENUM_ZONE_ID ids[] = {ZONE_ID_SYDNEY, ZONE_ID_TOKYO, ZONE_ID_FRANKFURT, ZONE_ID_LONDON, ZONE_ID_NEWYORK};

for ( integer i = 0 ; i < array size (id); i++)
    {
      ENUM_ZONE_ID id = ids[i];

      CTimeZoneInfo tz(id);
      tz.RefreshTime();

DateTimeLocalTime = tz.TimeLocal ();

//--- Set the session time to 8:00 AM - 5:00 PM local time datetime start local = string to time ( string time (localtime, TIME_DATE ) + " " + "08:00" );
datetime terminal local = string to time ( string time (localtime, TIME_DATE ) + " " + "17:00" );

//--- Convert to broker time tz.SetLocalTime(beginlocal);
Date and time beginbroker = tz.ConvertLocalTime(ZONE_ID_BROKER);

      tz.SetLocalTime(endlocal);
Date and time endbroker = tz.ConvertLocalTime(ZONE_ID_BROKER);

//--- Local day of the week in time zone Mql date time stone;
buildtime (localtime,st);
Integer Dow = st.day_of_week;

//string state_str = ((dow != SATURDAY && dow != SUNDAY) && (localtime >= beginlocal && localtime < endlocal)) ? "open" : "off"; string state_str = ((dow != Saturday && dow != Sunday ) && ( timeTradingServer () >= startbroker&& timeTradingServer () < endlocal)) ? "open" : "off" ;

Print format ( "%-12s: %s | %s [session %s]" , tz.Name(), CTimeZoneInfo::FormatTimeForPlace(beginbroker, ZONE_ID_BROKER), CTimeZoneInfo::FormatTimeForPlace(endbroker, ZONE_ID_BROKER), state_str);
    }

Print ( "-----------" );
print ( "Broker Time:" , TimeTradingServer ());
print ( "Broker Time: " , CTimeZoneInfo::FormatTimeForPlace( TimeTradingServer (), ZONE_ID_BROKER));

Output:

 // ======= Local session time (class CTimeZoneInfo) ======= // Sydney : Wednesday, 28 February 2024 23:00:00 GMT+2 [FXOpen-MT5] | Thursday, 29 February 2024 08:00:00 GMT+2 [FXOpen-MT5] [Session ended] // Tokyo : Wednesday, 28 February 2024 Wednesday, 28 February 2024 01:00:00 GMT+2 [FXOpen-MT5] | Wednesday, 28 February 2024 10:00:00 GMT+2 [FXOpen-MT5] [Conference ended] // Frankfurt : Wednesday, 28 February 2024 09:00:00 GMT+2 [FXOpen-MT5] | Wednesday 28 February 2024, 18:00:00 GMT+2 [FXOpen-MT5] [Session Open] // London : Wed, 28 Feb 2024 10:00:00 GMT+2 [FXOpen-MT5] | Wed, 28 Feb 2024 19:00:00 GMT+2 [FXOpen-MT5] [Session Open] // New York : Wed, 28 Feb 2024 15:00:00 GMT+2 [FXOpen-MT5] | Thursday, February 29, 2024 00:00:00 GMT+2 [FXOpen-MT5] [Session Open] // ----------------------------------- // Broker Time: 2024.02.28 15:32:30 // Broker Time: Wednesday, 2024.02.28 15:32:30 GMT+2 [FXOpen-MT5]


Purpose : Class that accesses local trading sessions for a specified location.

Derived from class C time zone information .

Notes : The new default session time is set to 8:00 AM to 5:00 PM local time C session time object. These default values ​​can be overridden as needed.

Let's look at an example of how to use this object.

print ( "\n========== Using CSessionHours object ==========" );

  CSessionHours tz(ZONE_ID_SYDNEY);
  tz.RefreshTime(); // Populate time zone and session information //--- from parent print ( "Name(): " , tz.Name());
print ( "TimeUTC():" , tz.TimeUTC());
print ( "TimeLocal():" , here. TimeLocal ());
print ( "ToString():" , tz.ToString());
//--- from class print ( "BeginLocalTime():" , tz.BeginLocalTime());
print ( "EndLocalTime(): " , tz.EndLocalTime());
print ( "CheckLocalSession():" , tz.CheckLocalSession());
print ( "SecRemainingSession():" , tz.SecRemainingSession());
print ( "SecondsToString():" , CSessionHours::SecondsToString(tz.SecRemainingSession()));

Output:

 // ========== Using the CSessionHours object ========== // Name() : Sydney // TimeUTC() : 2024.02.28 10:58:50 // TimeLocal() : 2024.02.28 21:58:50 // ToString() : Wednesday, February 28, 2024 21:58:50 GMT+11 [Sydney] (Daylight Saving Time) // BeginLocalTime() : 2024.02.28 08:00:00 // EndLocalTime() : 2024.02.28 17:00:00 // CheckLocalSession() : false // SecRemainingSession() : 0 // SecondsToString() : 00:00:00


This C session provides more functionality with less code. Let’s look at an example to show how to get the Forex trading times for all time zones using the C Session Time class and convert them to the broker’s time. Note that converting to broker time is an optional step and not required for checking the start and end times of each session .

print ( "\n======== Local session time (CSessionHours class)=======" );

Constant ENUM_ZONE_ID ids[] = {ZONE_ID_SYDNEY, ZONE_ID_TOKYO, ZONE_ID_FRANKFURT, ZONE_ID_LONDON, ZONE_ID_NEWYORK};

for ( integer i = 0 ; i < array size (id); i++)
    {
      ENUM_ZONE_ID id = ids[i];

      CSessionHours tz(id);
      tz.RefreshTime();

//--- The default session time is set to 8:00 AM - 5:00 PM local time date time beginlocal = tz.BeginLocalTime();
Date and time endlocal = tz.EndLocalTime();

//--- Convert to broker time date time beginbroker = CTimeZoneInfo::ConvertTimeForPlace(beginlocal, id, ZONE_ID_BROKER);
Date and time endbroker = CTimeZoneInfo::ConvertTimeForPlace(endlocal, id, ZONE_ID_BROKER);

string state_str = tz.CheckLocalSession()? "Open, ended with" + CSessionHours::SecondsToString(tz.SecRemainingSession()) : "Close" ;

Print format ( "%-12s: %s | %s [session %s]" , tz.Name(), CTimeZoneInfo::FormatTimeForPlace(beginbroker, ZONE_ID_BROKER), CTimeZoneInfo::FormatTimeForPlace(endbroker, ZONE_ID_BROKER), state_str);
    }

Print ( "-----------" );
print ( "Broker Time:" , TimeTradingServer ());
print ( "Broker Time: " , CTimeZoneInfo::FormatTimeForPlace( TimeTradingServer (), ZONE_ID_BROKER));
print ( "Forex closing price: " , CTimeZoneInfo::FormatTimeForPlace(CSessionHours::ForexCloseTime(), ZONE_ID_BROKER));
Integer sec = CSessionHours::SecRemainingForex();
print ( "Ends with: " , seconds, "seconds=" , CSessionHours::SecondsToString(sec));

Output:

 // ======= Local session time (class CSessionHours) ======= // Sydney : Wednesday, 28 February 2024 23:00:00 GMT+2 [FXOpen-MT5] | Thursday, 29 February 2024 08:00:00 GMT+2 [FXOpen-MT5] [Session ended] // Tokyo : Wednesday, 28 February 2024 Wednesday, 28 February 2024 01:00:00 GMT+2 [FXOpen-MT5] | Wednesday, 28 February 2024 10:00:00 GMT+2 [FXOpen-MT5] [Conference ended] // Frankfurt : Wednesday, 28 February 2024 09:00:00 GMT+2 [FXOpen-MT5] | Wednesday 28 February 2024, 18:00:00 GMT+2 [FXOpen-MT5] [Conference started, ended at 02:27:29] // London : Wednesday, 28 February 2024 10:00:00 GMT+2 [FXOpen-MT5] | Wednesday, 28 February 2024 19:00:00 GMT+2 [FXOpen-MT5] [Conference started, ended at 03:27:29] // New York : Wednesday, 28 February 2024 15:00:00 GMT+2 [FXOpen-MT5] | Thursday, 29 February 2024 00:00:00 GMT+2 [FXOpen-MT5] [Session started, ended at 08:27:29] // ---------------------------------- // Broker Time: 2024.02.28 15:32:30 // Broker Time: Wednesday, 2024.02.28 15:32:30 GMT+2 [FXOpen-MT5] // Forex closing price: Saturday, 2024.03.02 00:00:00 GMT+2 [FXOpen-MT5] // End time: 203249 seconds = 2d 08:27:29


Let's look at an example to show how to override the default session time with the C session time class.

print ( "\n============ Override default session time ============" );

  CSessionHours Frankfurt(ZONE_ID_FRANKFURT);

//Change the default session time Frankfurt.BeginLocalTime( 9 , 0 );
  Frankfurt.EndLocalTime( 19 , 0 );

  Frankfurt.RefreshTime(); // Fill in the new session time date time beginlocal = Frankfurt.BeginLocalTime();
DateTime endlocal = Frankfurt.EndLocalTime();

Print format ( "New session time: %s | %s" , CTimeZoneInfo::FormatTimeForPlace(beginlocal, ZONE_ID_FRANKFURT), CTimeZoneInfo::FormatTimeForPlace(endlocal, ZONE_ID_FRANKFURT));
Print format ( "Current local time: %s" , Frankfurt.ToString());

Output:

 // =========== Override default session time =========== // New meeting time: Wednesday, 28 February 2024 09:00:00 GMT+1 [Frankfurt] | Wednesday 28 February 2024 19:00:00 GMT+1 [Frankfurt] // Current local time: Wednesday, 2024.02.28 11:58:50 GMT+1 [Frankfurt]


The SecRemainingForex() static method will return the remaining time (in seconds) before the Forex market closes for the week. The method should repeatedly check for shutdown from the OnTick() event handler ( or better yet from Timer() if no ticks appear before the weekend) . Let's look at an example of how to check the closing of a weekend position.

 Print ( "\n======== Check weekend position closing ======== );

Integer InpH hours = 2 ; // Hours before the weekend Inp minutes = 30 ; // Integer minutes before the weekend sec = CSessionHours::SecRemainingForex();
Print format ( "Time left until weekend: %s" , CSessionHours::SecondsToString(sec));
Print format ( "If remaining time becomes %s or less, close all." , CSessionHours::SecondsToString(InpHours * 3600 + Inp minutes * 60 ));

// Check if the remaining time reaches the target if (seconds <= InpH hours * 3600 + Inp minutes * 60 )
    {
// Close all(); }

Alternatively, you can use absolute time to check a previous condition:

 // Check if the broker's time reaches the target if ( TimeTradingServer () >= CSessionHours::ForexCloseTime() - (InpHours * 3600 + Inp Minutes * 60 ))
    {
// Close all(); }

Output:

 // ======= Check weekend closing status ======= // There is still time until the weekend: 3d 03:32:27 // If the remaining time becomes 02:30:00 or less, close all.


The foreign exchange market opens at 17:00 New York time on Sunday (GMT-5 in winter and GMT-4 in summer) and closes at the same time on Friday. New York City opening hours correspond to Sunday 10:00 PM UTC in winter (Sunday 09:00 UTC in summer). Forex closes on Friday at 10:00 PM UTC in winter (09:00 PM UTC in summer). Gold and silver spot markets typically open one hour later. association

Each Forex broker has its own time zone and server time. Therefore, the start of the trading week (H1 candle) is variable between brokers and may vary Server time Sunday 02:00 PM For brokers in San Francisco (GMT-8), the highest Server time Monday 09:00 AM Available to brokers in Sydney (GMT+11). Trading week end times also vary Friday 02:00 PM server time , until Server time Saturday morning 09:00.

Every broker is free to choose Daylight Saving Time (DST). And DST is not necessarily the same as that time zone. Sometimes they use a mix of EU time zones and US Daylight Savings Time instead of EU Daylight Savings Time. For brokers that do not follow the US schedule, there will be a +/- 1 hour difference in server times at the start (and end) of each week for the same broker throughout the year. The FX CloseTime() method handles these inter-broker and intra-broker variations by converting New York Friday's 17:00 closing time to the broker's time, taking into account time offsets and daylight saving time, thus providing accurate results.

Therefore, using the +2 time zone (+3 in the US time zone during the summer) means 5 D1 candles per week. No candles are lit on Saturdays and Sundays throughout the year. Simply, the time on these servers is always 7 hours ahead of New York and is expressed as NY+7. This is by far the most common setup, but there are many less common variations.

Example indicator TestIndi.mq5

Local Timezones and Local Session Hours - library for MetaTrader 5

iForexSessions - MetaTrader 5 script

Forex Market Trading Highlights

Get it here https://www.mql5.com/en/code/48842

World Clock: https://www.timeanddate.com/worldclock/

Time zone converter: https://www.timeanddate.com/worldclock/converter-classic.html

2024.03.01 - v.1.40: Removed redundant code in CTimeZoneInfo class (used during testing), added more methods to CSessionHours class, updated TestIndi.mq5 to reflect new changes.

2024.03.03 - v.1.45: Updated sample code for "Using local session time - CTimeZoneInfo class".

2024.03.08 - v.1.50: Added two internal methods Historical Broker Offset and First Bar of the Week to the CTimeZoneInfo class. Handle past server time (UTC offset, text formatting, conversions, etc.).

2024.03.15 - v.1.56: Added script 'SydneySession_Script.mq5' to show how session times in Sydney fluctuate throughout the year.

2024.03.30 - v.1.65: Fixed broker GMT offset. Currently, the library only scans the H1 bar on the GOLD chart as it has the most accurate start time of all the brokers I have tested.

2024.04.01 - v.1.67: Fixed a potential issue in broker GMT offset calculation during the first hour of the trading week.

2024.04.03 - v.1.70: Cache broker GMT offsets into a hash map for faster retrieval (e.g. from indicators). The broker's offset cache will contain one entry per trading week.

2024.04.08 - v.1.72: Improved the performance of the library by at least 2-3 times. Now internally uses StructToTime instead of StringToTime to get the Nth Sunday method.

2024.04.09 - v.1.75: Fixed potential issue with calculating broker GMT offset for GMT+0 brokers during the Christmas holidays.

2024.04.11 - v.1.77: Accelerate daylight switching time method. Now use a static array to remember the switching time for the current year.

2024.04.12 - v.1.80: Fixed an issue in GMT offset calculation for brokers that do not offer gold trading.

2024.04.15 - v.1.82: Added method to set custom time zone CTimeZoneInfo class, which you can use to configure a built-in custom time zone with a specified name, GMT offset, and DST identifier. Custom time zones can be accessed via ZONE_ID_CUSTOM.

2024.04.16 - v.1.85: Replaced the GetNthSunday internal method with the more optimized GetMonthTime method.

2024.04.17 - v.1.87: Replaced the TimeYear internal method to get the year with a more optimized method.

2024.04.18 - v.1.88: Added internal method for constructing datetime values ​​from date components (year, month and day). This is 100-120 times faster than calling the StructToTime function.

2024.10.22 - v.1.93: Faster determination of server's GMT offset during weekend live trading.

2024.10.26 - v.1.95: Two new static methods added: TimeGMT Offset() and TimeDaylight Savings() . Renamed the Historical Broker Offset () method to TimeServerGMTOffset ().

2024.10.28 - v.1.97: Convert all processing time macros into functions to avoid double calculation of parameters within the macro body. More code cleanup in other lines.

2024.10.30 - v.1.98: Fixed an issue with incorrect GMT offset estimation in XAUEUR quotes for some brokers.

2024.11.01 - v.1.99: Added an option to turn off loading gold symbols by default to estimate the server's TZ/DST. CallC TimeZoneInfo :: Set the symbol used by the current chart using GoldSymbol() with "false".

2024.11.13 - v.2.00: Improved estimation in online server tz/dst and policy policies (TimeGMT library no longer required). The constructor accepts location and time parameters. New public methods for working with datetime type data. Improved error handling and debugging support.

2024.11.14 - v.2.02: Fixed error ERR_HISTORY_NOT_FOUND (4401) when trying to access XAUUSD, H1 quote history via server time zone object.

2024.11.17 - v.2.03: Minor bug fixes.

2024.11.23 - v.2.04: Minor improvements and bug fixes.

2024.12.05 - v.2.05: Added new static method DaylightSavingsSupported(placeId).

2024.12.12 - v.2.10: Improved performance of the HistoryServerGMTOffset() and HistoryServerDaylightSavings() functions, as well as other minor code changes.

2024.12.14 - v.2.11: Improved the performance of FindSymbol() function.

2024.12.17 - v.2.12: Further optimize the HistoryServerGMTOffset() and HistoryServerDaylightSavings() functions.

2024.12.24 - v.2.13: Fixed potential issue in HistoryServerGMTOffset() and HistoryServerDaylightSavings() functions.

2025.01.12 - v.2.15: Fixed an issue in HistoryServerDaylightSavings() with searching for tick history older than the loaded history in the strategy tester.

2025.10.13 - v.2.17: Minor improvements and bug fixes.


Attachment download

📎 TimeZoneInfo.mqh (121.12 KB)

📎 SessionHours.mqh (17.48 KB)

📎 print_times.mq5 (1.7 KB)

📎 examples.mq5 (67.07 KB)

📎 TestIndi.mq5 (14.95 KB)

📎 server_tz_changes.mq5 (7.85 KB)

Source: MQL5 #48419

MT5 MQL5 CodeBase Local time zone and local session time library
Verification code Refresh