JScript has native
Date object that was especially created to hold the date-time values and has its own methods to manage dates and time. The complete description for the
Date object is provided in MSDN (the online version is available at http://msdn.microsoft.com). Since C#Script and C++Script are based on JScript, the Date object is also available in these scripting languages. The sample code below demonstrates how to create this object.
However the TestComplete
Utilities object methods can only operate with the variant date-time values. To convert variant values to instances of the
Date object and vice versa you can use the following routines. The first one accepts the variant value as input parameter and returns the object instance and the second routine does the reverse, it accepts the object instance and returns the variant.