Hi,
according to Java Docs:
HOUR_OF_DAY
Field number for get and set indicating the hour of the day. HOUR_OF_DAY is used for the 24-hour clock. E.g., at 10:04:15.250 PM the HOUR_OF_DAY is 22.
The JForex platform uses GMT=0, so you need to initialize your calendar instance correctly:
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT 0"));
After creating such an instance it will be in sync with the platform and you cat fetch required time fields using appropriate constants, e.g. HOUR_OF_DAY.
If you are using the backtester you should reset calendar instance time, because you operate with historical data and not with the current time. Each time you get data from historical tester, you should set time to your calendar instance using this method:
public void setTimeInMillis(longВ millis)
Sets this Calendar's current time from the given long value.
and then fetch the appropriate time field.