Help Needed in this code

 

hi, I'm trying to get the open time for current order by using this code : int orders, total, j; datetime Open_Time; orders = 0; total = OrdersTotal (); for (j = 0; j < total; j++) { OrderSelect (j, SELECT_BY_POS, MODE_TRADES); if (OrderMagicNumber() == Magic && OrderSymbol() == Symbol()) { orders++; Open_Time = OrderOpenTime(); } }

the value I got for the Open_Time = 1258340974 my question : 1) is the code I used is correct? 2) what does it mean with the value I got and how to translate to correct date and time value? your help is much appreciated!

 
bumi wrote >>

hi, I'm trying to get the open time for current order by using this code : int orders, total, j;datetime Open_Time;orders = 0;total = OrdersTotal (); for (j = 0; j < total; j++) { OrderSelect (j, SELECT_BY_POS, MODE_TRADES); if (OrderMagicNumber() == Magic && OrderSymbol() == Symbol()) { orders++; Open_Time = OrderOpenTime(); } }

the value I got for the Open_Time = 1258340974my question : 1) is the code I used is correct? 2) what does it mean with the value I got and how to translate to correct date and time value? your help is much appreciated!

time as number of seconds elapsed from 00:00 January 1, 1970.

 
EADeveloper:

time as number of seconds elapsed from 00:00 January 1, 1970.


can you guide how to translate the value to the correct date and time?


thanks in advance! :)

 
bumi:


can you guide how to translate the value?

TimeToStr()