Download MetaTrader 5

how to change long --> datetime ?

To add comments, please log in or register
LEE Chun Wing
831
LEE Chun Wing  

how to change long --> datetime ?

PositionSelect(break_bar.symbol); /*而家 一個SYMBOL 只可用一個” 利用OPEN_TIME既策略”, 除非 用FILEWRITE 左新個OPEN_TIME*/
   open_time = PositionGetInteger(POSITION_TIME); 

the long is open_time, i want to print it out to debug, but the first thing to do before Print() is to convert open_time from long to datetime format

 

how to do it ?

thanks 

LEE Chun Wing
831
LEE Chun Wing  

the problem that i directly use

Print("open_time") ;

is it's output is

open_time = 1281436292 

but i want the format to be like this:  2010.08.10 07:00:00 

 

how can i do it?

i really puzzle~ ~ 

Rashid Umarov
Admin
12611
Rashid Umarov  

Use

   open_time =(datetime) PositionGetInteger(POSITION_TIME);

LEE Chun Wing
831
LEE Chun Wing  
Rosh:

Use


thanks, rosh

it is work^^ 

To add comments, please log in or register