Download MetaTrader 5
To add comments, please log in or register
Publish programs in Code Base. Improve your rating!
franzk
70
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
5962
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