This happens when you try to convert between different datatypes the compiler is warning you that there can be dataloss.
The old MT4 function ObjectGet() returns a "double" datatype. However, when getting a different type of data, such as a "datetime", you must typecast it to prevent the warning. So, your code would have to be as follows (both formats are valid):
// either the "C" styledatetime time = (datetime) ObjectGet( "name", OBJPROP_TIME2 );// or the function styledatetime time = datetime( ObjectGet( "name", OBJPROP_TIME2 ) );
Please note however, that ObjectGet() is an older MT4 function and you should instead use the more modern version ObjectGetInteger() (as mentioned by Marco vd Heijden in the previous post) which is also compatible with MQL5.
You will however, still need to typecast it for a datetime data type, even with the newer function!