How to change time format to include seconds? (eg;from "15:30" to "15:30:55")

 
Hi Guys,i have been doing a bit of coding and have encountered a bit of a problem i would like you to help me on,how do i change the time format to read "15:30:50" instead of showing "15:30" as shown below(i would like the seconds to show as well);

if (PositionsTotal()==0 && OrdersTotal()==0 && (StringSubstr(hoursAndMinutes, 0,5)=="15:30")&&NewBar())

i  tried changing the "time_minute" parameter to "time_seconds" on the Timetostring as shown below,;


string hoursAndMinutes =TimeToString(time,TIME_ MINUTES);
i changed the above code to the one below, it still wont work,it remains on "15:30" and not "15:30:50"

string hoursAndMinutes =TimeToString(time,TIME_ SECONDS);
 
please help.
 
  1. TIME_MINUTES|TIME_SECONDS just like the documentation shows.
  2. Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
              Messages Editor