Struggling to get a proper deal time from HistoryDealGetInteger

 
Hi Guys, as the topic states, HistoryDealGetInteger, doesnt give me a proper time when using the DEAL_TIME enum

I get a value like 1578062560.

Could anyone advise what im doing wrong?

Im without Internet so I cant copy paste my code in the right format using android, apologies for that

Regards

datetime from = TimeToString(0,TIME_DATE);
HistorySelect (from, TimeCurrent());
int Deals=HistoryDealsTotal();
int LastDealTime=HistoryDealGetInteger(Deals,DEAL_TIME);
 
Arno van Niekerk:
Hi Guys, as the topic states, HistoryDealGetInteger, doesnt give me a proper time when using the DEAL_TIME enum

I get a value like 1578062560.

Could anyone advise what im doing wrong?

Im without Internet so I cant copy paste my code in the right format using android, apologies for that

Regards

datetime from = TimeToString(0,TIME_DATE);
HistorySelect (from, TimeCurrent());
int Deals=HistoryDealsTotal();
int LastDealTime=HistoryDealGetInteger(Deals,DEAL_TIME);

Please use the code button.

That time is an integer of the number of (seconds?) that have passed since 1970. 

Use a datetime typecast to get the value as a date. 

Like so:

datetime from = TimeToString(0,TIME_DATE);
HistorySelect (from, TimeCurrent());
int Deals=HistoryDealsTotal();
//***
int LastDealTime=(datetime)HistoryDealGetInteger(Deals,DEAL_TIME);
 
Nelson Wanyama:

Please use the code button.

That time is an integer of the number of (seconds?) that have passed since 1970. 

Use a datetime typecast to get the value as a date. 

Like so:

Thank you for the reply, but adding the datetime typecast doesnt do anything, is there another way?
 
datetime LastDealTime=HistoryDealGetInteger(Deals,DEAL_TIME)
This did the trick tho! thanks for the help mate.
 
Arno van Niekerk:
This did the trick tho! thanks for the help mate.

You are welcome.

Reason: