I wrote a JS code that works well on a browser but does not work if i run it from Construct 2.
JS code :
function calc(){
var b = new Date();
var mydate = new Date('Sun Jul 16 2017 11:58:38 GMT+0300 (???? ??? ???????)');
return (b - mydate) / 1000;
}
alert(calc());
on Construct 2 :
Browser.ExecJS("
var b = new Date();
var mydate = new Date('Sun Jul 16 2017 11:58:38 GMT+0300 (???? ??? ???????)');
return parseInt((b - mydate) / 1000);")
i get always '0' but if I replace the return to alert It works well. I tried to get it back to number and text var.