Forum Discussion

adam_gataev's avatar
adam_gataev
New Contributor II
2 years ago
Solved

Get MIN (oldest) or MAX (most recent) date from array of dates

Hi, I first do an SQL Server - Execute and get this weird {_snaptype_localdatetime: "..."} for the CreationDate and LastUpdate fields. Then, using a Mapper snap I do toString() to just get the date ...
  • j_angelevski's avatar
    3 years ago

    @ykoppisetty

    It is because the parse method expects a number but you are providing a string value.
    You need to parse the “Modified_Date”, you can do so by using parseInt(string).

    In your case would be:

    parseInt($Modified_Date)
    

    And the full expression to format the date would be:

    Date.parse(parseInt($Modified_Date))