10-16-2017 04:17 AM
I need to find the date different between two dates. There is no option available for datediff in SnapLogic.
I tried with minus function in expression but won’t work.
date1 - date2 also won’t work
datatype:date-time
date 1: 2017-10-16T09:42:01.582
date 2: 2017-08-08T00:00:00.000
10-16-2017 06:25 AM
See also this thread How to obtain difference btw 2 timestamp?
10-16-2017 10:38 PM
Yes I have found the solution using the getTime() but its limited to date-time datatype. If suppose the datatype may vary facing undefined getTime issue for local-date-time and etc.
date difference:
Math.floor(($date1.getTime() - $date2.getTime() ) / (1000 * 60 * 60 * 24))
10-17-2017 09:32 AM
I checked with Dev and historically we’ve seen people format the local time into a string and then do Date.parse().