Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: date calculation

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default date calculation

    1)How to do (present date - 3days)? Is it possible to use DateDiff function in script?
    Need to get the format in yyyy-mm-dd hh:mm:ss .

    2)I am using Sys info in all the tranformation to load current timestamp into the tables(Table output).
    Will this object cause any performance issue?Is it better to use sysdate in scripts?

  2. #2
    DEinspanjer Guest

    Default

    1. What do you mean is it possible to use DateDiff? Did you try it and it didn't work? More details. The Calculator step also has date functions to do things like this.

    2. System Info is a very fast step. It should always be the better choice over using JS code in a JS step.

  3. #3

    Default

    Solved it!

    var
    d1 = time.getDate();

    var d2 = dateAdd(d1,"d",-15);

    Never thought of using Add function to subtract



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.