Download MetaTrader 5

unexpected behaviour datetime 840 vs 890

To add comments, please log in or register
Do you want to deposit to your account? Do this in any convenient way!
franzk
80
franzk 2015.10.16 09:31 

Hi,

this sample code is behaving different in the build 840 vs build 890. Is this desired behaviour? 

string tstamp = "1444977373";
Print((datetime)tstamp);
Print((datetime)(ulong)tstamp);

 

Output:

build 890
2015.10.16 11:24:23.962 test EURUSD,H1: 2015.10.16 06:36:13
2015.10.16 11:24:23.962 test EURUSD,H1: 2015.10.16 11:24:23

build 840
2015.10.16 11:25:26.729 test EURUSD,H1: 2015.10.16 06:36:13
2015.10.16 11:25:26.729 test EURUSD,H1: 2015.10.16 09:25:26
Carl Schreiber
6580
Carl Schreiber 2015.10.16 09:54  

May be yu should try to use long l = StringToInteger(tstamp); Print((datetime)l);

I think this is a better way of type casting.

To add comments, please log in or register