โ08-09-2019 05:54 AM
I am passing a timestamp as a variable through pipeline parameter as โp_querystring_modifieddateafterโ.
while applying logic as below in mapper and in REST GET snap parameters, I am getting the failure :
Logic in Mapper :
_p_querystring_modifieddateafter.minusDays(1).toLocaleDateString()+โT00:00:00.000โ
tried with below logic also, still failing,
LocalDateTime.parse(_p_querystring_modifieddateafter).minusDays(1).toLocaleDateString()+โT00:00:00.000โ
let me know if i am making any mistakeโฆ
โ08-09-2019 09:44 AM
Can you give an example of one of these timestamps? It looks like LocalDateTime.parse()
is not parsing it correctly and returning a NaN
. Also, is there are reason youโre using LocalDateTime.parse()
instead of Date.parse()
? Note that LocalDateTime
objects do not have the date math methods like minusDays()
.
โ08-09-2019 12:38 PM
Ex :
2019-08-09T06:51:07.000
this need to be converted like : 2019-08-08T00:00:00.000
โ08-09-2019 01:07 PM
This expression:
Date.parse(โ2019-08-09T06:51:07.000โ).minusDays(1).toLocaleDateString()+โT00:00:00.000โ
results in: 2019-08-08T00:00:00.000
Note the only change in the expression from your original one is the use of Date.parse() instead of LocalDateTime.parse()
โ08-10-2019 12:45 AM
for this logic :
Date.parse(โ2019-08-09T06:51:07.000โ).minusDays(1).toLocaleDateString()+โT00:00:00.000โ
error :
Could not compile expression: Date.parse(โ2019-08-09T06:51:0 โฆ (Reason: Invalid token: โโโ for expression: Date.parse(โ2019-08-09T06:51:0 โฆ; Resolution: Please check expression syntax)
attached are screenshots.