how we use seconds() in mql5

 

hi

In mql4 for counting seconds from the start of the minutes
we have Seconds()
What is the equivalent of this function in mql5?

In other words, how can I have in a mql5 seconds in a minute

 
int Seconds( const datetime time )
{
  return((int)time % 60);
}
 
fxsaber:

Excuse me how should I use this code

 
moslemS:

Excuse me how should I use this code

int Seconds( void )
{
  return((int)TimeCurrent() % 60);
}

void OnStart()
{
  Print(Seconds());
}
 

This is the equivalent function:

int SecondsMQL4()
{
   MqlDateTime tm;
   TimeCurrent(tm);
   return(tm.sec);
}

See here the complete guide "Migrating from MQL4 to MQL5":

https://www.mql5.com/en/articles/81

Migrating from MQL4 to MQL5
Migrating from MQL4 to MQL5
  • 2010.05.17
  • Sergey Pavlov
  • www.mql5.com
This article is a quick guide to MQL4 language functions, it will help you to migrate your programs from MQL4 to MQL5. For each MQL4 function (except trading functions) the description and MQL5 implementation are presented, it allows you to reduce the conversion time significantly. For convenience, the MQL4 functions are divided into groups, similar to MQL4 Reference.
 
fxsaber:

thank you very much

 
Peter Thomet:

This is the equivalent function:

See here the complete guide "Migrating from MQL4 to MQL5":

https://www.mql5.com/en/articles/81

thank you very much

Reason: