Error in the event time from MqlCalendarValue.

 
I have noticed what seems to be an error in the way the event time retuned from MqlCalendarValue. There seems to be an error in the way server time is being calculated (since all time values are returned using server time as per documentation). Below I have attached samples of this error. 
The examples below are on MT5 Version 5.0 Build 4274 and an MT5 Demo Account, GMT+3. 

Clock changes to keep in mind:
- MT5 accounts changed the GMT offset on 31st March 2024 and looking back it seems to align with clock changes in London for DST.
- As for this year, NewYork DST was on 10 Mar 2024 .

Below is a screenshot of a GBPJPY chart on 7th March 2024 with the start of the green rectangle marking the start of NewYork session which usually also marks the release of some key events. In the example, the returned date of the events `Challenger Job cuts` which occur at NewYork 8:30AM are marked appropriately i.e. at the expected time. 
Correctly working on 7th March 2024

Now when we go to 12th March 2024 (after  NewYork DST changes on 10th march), the datetime returned as the event time doesnt seem to take this into account as shown below. 

12th March 2024

When we move over to 3rd April ( After London and MT5 Demo Account adjust their clocks), the event time returned is as expected. This for me suggests that there is an error in the way the event time ( server time )is calculated . or maybe I'm just wrong. 

3rd April 2024
 
It seems I attached the wrong screenshot for 3rd April and since I cant find a way to edit the original posit, the correct one is as below. 
3rd April 2024.png
 
Correction: Even in the first image for  7th March 2024, the event times are all wrong since (and so was i in stating that  `Challenger Job cuts` event occurred at NewYork 8:30AM since it is actually at New York 7:30 AM) . Below is a screenshot of the News on that day from forexfactory (https://www.forexfactory.com/calendar?day=mar7.2024) with the NewYork time zone set. 

Screenshot forexfactory 7th Mach 2024, NY timezone
Forex Calendar | Forex Factory
Forex Calendar | Forex Factory
  • www.forexfactory.com
Anticipate market-moving events long before they happen with the internet's most forex-focused economic calendar.
 
I solved this problem.
#include <fxsaber\Calendar\Calendar.mqh> // https://www.mql5.com/ru/code/32430

void OnStart()
{
  CALENDAR Calendar;
  
  if (Calendar.Set("USD", CALENDAR_IMPORTANCE_NONE, D'2024.03.12', D'2024.03.13'))
  {        
    Calendar.AutoDST();
    
    Print(Calendar.ToString());
  }           
}
 
fxsaber #:
I solved this problem.

I eventually grasped that when the documentation mentions that `All functions for interacting with the economic calendar utilize the trade server time (TimeTradeServer)`, it signifies synchronization with the broker's GMT offset settings. Hence, when examining datetimes that don't match the broker's current GMT offset, adjustments are necessary. Thanks for your help. 

Documentation on MQL5: Economic Calendar
Documentation on MQL5: Economic Calendar
  • www.mql5.com
This section describes the functions for working with the economic calendar available directly in the MetaTrader platform. The economic calendar is...