TimeCurrent output in seconds elapsed in MQL5

To add comments, please log in or register
bhongya
11
bhongya  

Hi,

 

How do I get the output of following functions in seconds as compared to TimeStamp in MQL5?

int OnCalculate(..... const datetime &Time[]...........)  //just cut short the oncalculate function. Using the default one 

  {

      Print("Time=============",Time[0]);

      Print("TimeCurrent=============",TimeCurrent());

   return(rates_total);

  }

 The output I get in MQL5 is like

TimeCurrent=============2012.06.07 21:29:41

 

But in MQL4 I get  

TimeCurrent=============1339108206

 

I want the output as like  MQL4 in MQL5 . How do I achieve it? 

 

Thanks. 

Documentation on MQL5: Language Basics / Functions / Event Handling Functions
  • www.mql5.com
Language Basics / Functions / Event Handling Functions - Documentation on MQL5
Biantoro Kunarto
20048
Biantoro Kunarto  

Try this

Print((long)TimeCurrent());
bhongya
11
bhongya  
biantoro:

Try this

Awesome. Thank you :)

 

Biantoro Kunarto
20048
Biantoro Kunarto  

ok
To add comments, please log in or register