Open & Close time question.

 

Hi all! I am using the "OrderCloseTime()" function and "printing" the result in the MT4 journal. I do not recognize the format of the "printed" "OrderCloseTime()". I will provide an example below...

example: "Close time for the order 1 1167720180"

My brain is thinking... "WTF"? :) hahaha... Please excuse my indiscretion. Anyhow... To the point: Is there a way to convert the digits into a format that is a bit less complex? Maybe a format that shows something like "3:45.35.07.29.2012". :) Thanks much!

(Hours:Minutes.Seconds.Month.Day.Year)

 
Time is a datetime . . . if you want to see a datetime as a string then simply convert it . . . TimeToStr()
 
WhooDoo22:

Hi all! I am using the "OrderCloseTime()" function and "printing" the result in the MT4 journal. I do not recognize the format of the "printed" "OrderCloseTime()". I will provide an example below...

example: "Close time for the order 1 1167720180"

My brain is thinking... "WTF"? :) hahaha... Please excuse my indiscretion. Anyhow... To the point: Is there a way to convert the digits into a format that is a bit less complex? Maybe a format that shows something like "3:45.35.07.29.2012". :) Thanks much!

(Hours:Minutes.Seconds.Month.Day.Year)

https://docs.mql4.com/convert/TimeToStr

string TimeToStr( datetime value, int mode=TIME_DATE|TIME_MINUTES) 
 
Use TimeToStr( ) function
 

The verdict is to use the TimeToStr() function. I'll give it a shot when I get a chance.

Thanks for your posts everyone! :)