Download MetaTrader 5

unexpected behaviour datetime 840 vs 890

To add comments, please log in or register
franzk
82
franzk  

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
7297
Carl Schreiber  

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