Problem with setting DateTime variable

Hello,

I have problem with setting DateTime to the variable using JScript in FinalBuilder. I have following script:

var date = new Date();
Action.SendLogMessage("New date");
date.setTime(FBVariables.p_SectionLastRunTimeUTC);
Action.SendLogMessage("Set time: " + date.toString());
FBVariables.p_SectionLastRunTime = date;  <---- Here is an error
Action.SendLogMessage("Set last time");

 

Variable: p_SectionLastRunTimeUTC is integer, variable p_SectionLastRunTime is DateTime. I'm using FinalBuilder 7.0.0.1065

 

How it should be done correctly? 

--

best regards 

Adam Siwon

 

Hi Adam

The problem here is that the FinalBuilder DateTime variable type is the Delphi TDateTime type, which is why your script is failing when you attempting to assign a javascript date type to your variable.

If you change your variable type to Variant this will work correctly.

Regards,
Steve

It might also work if you use VBScript as I believe the VBScript Date type is compatible with Delphi (they are both com compatible datetimes).