IT Process Automation

 View Only
  • 1.  Compare dates to get the oldest

    Posted Sep 11, 2019 02:31 PM
    Edited by Douglas Molina Sep 11, 2019 02:32 PM
    Hi all

    I'm trying to compare the ScheduledStartTime with other date inserted in the description of the request..... i put this date in a varible but in this format (11/09/2019) (dd/MM/yyyy) but the format of this variable are Integer.

    I need convert this variable from integer to Date format first and after compare these two dates ok?

    Any suggestions

    Thanks and regards from Guatemala!!


  • 2.  RE: Compare dates to get the oldest

    Posted Sep 12, 2019 11:10 AM
    Greetings!

    In the screenshot I only see string and datetime. If you are referring to the number returned from SDM calls, that is the number of seconds since Jan1, 1970 UTC. Just add your number to that date to get the timestamp.

    For the string, I'd recommend using JavaScript Date.Parse to convert to a date for comparisons.

    Also remember to make sure all your time zones are the same.


  • 3.  RE: Compare dates to get the oldest
    Best Answer

    Posted Sep 12, 2019 01:17 PM
    Douglas,

    PAM supports ECMAScript 6, you can use almost every javascript code that was available in 2017.

    Type in google : javascript parse string to date

    You'll get approx 4 billions results. That will be way faster than asking here.


  • 4.  RE: Compare dates to get the oldest

    Posted Sep 26, 2019 03:20 PM
    I already solved it with some examples i found of ITPAM, thanks to those who helped.