MQL5 : Add time to current time in mins
datetime currentTime = TimeCurrent(); // Get the current time
int minutesToAdd = 30; // Example: Add 30 minutes
// Add minutes to current time (converted to seconds)
datetime newTime = currentTime + minutesToAdd * 60;
// Output the new time
Print("Current Time: ", TimeToString(currentTime, TIME_DATE | TIME_MINUTES));
Print("New Time: ", TimeToString(newTime, TIME_DATE | TIME_MINUTES));
Comments
Post a Comment