Working with Dates - Part 5: Converting to JScript Date object
Test and Monitor | Posted February 13, 2007

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 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.


By submitting this form, you agree to our
Terms of Use and Privacy Policy

Thanks for Subscribing

Keep an eye on your inbox for more great content.

Continue Reading

Add a little SmartBear to your life

Stay on top of your Software game with the latest developer tips, best practices and news, delivered straight to your inbox