Service Virtualization

  • 1.  How to get the current date and time in LISA or Javascript?

    Posted Mar 14, 2018 08:08 AM

    I tried Date() function in execute script step in LISA. But its throwing an error.

     

     

    var currentDate = new Date(),
    day = currentDate.getDate(),
    month = currentDate.getMonth() + 1,
    year = currentDate.getFullYear();
    d = day+month+year;
    testExec.setStateValue("Result","d");



  • 2.  Re: How to get the current date and time in LISA or Javascript?
    Best Answer

    Posted Mar 14, 2018 05:51 PM

    Hi,

    If you want to get the current date (run-time time stamp) use the Timestamp filter and store it in a property to use across the VSM or test case. You can do apply whatever the offset you need. 

    Time Stamp Filter - DevTest Solutions - 10.1 - CA Technologies Documentation   

     

    Best Regards,

    Venkat Yedida 



  • 3.  Re: How to get the current date and time in LISA or Javascript?

    Posted Mar 15, 2018 03:44 AM

    It was really helpful. Thanks Venkat.