SM 9.4 - is it possible to create a rule to set a date to 30 days beyond today?

is it possible to create a rule to set a date to 30 days beyond the current date/time?

I tried the following code that did not work:  

value=date(tod()) '30 00:00:00'"

  • Verified Answer

    Well, there are these two different date types:

    System Language date/time

    - to call System language function from JS, you'll need to use it like this: system.functions.tod(),

    and

    JavaScript Date.

     

    In Javascript, there are following constructors for Date object:

    var d = new Date();    // returns now
    var d = new Date(milliseconds);
    var d = new Date(dateString);
    var d = new Date(year, month, day, hours, minutes, seconds, milliseconds);

    So you can do this:

    var f = new Date(new Date().getTime() 1000 * 60 * 60 * 24 * 30);

     

  • that worked - we used a set field using using javascript and used

    value =  new Date(new Date().getTime() 1000 * 60 * 60 * 24 * 30);

    BOOOOOM!! Thanks!