Remove milliseconds on ISO8601 date and time

0
Hi all, Does anyone know how I can remove the milliseconds from a ISO8601 date and time attribute? I have tried trimToSeconds() but this rounds the milliseconds to 000Z which is not what I want.  Many thanks!
asked
3 answers
1

If you need this for showing the datetime without the milliseconds: formatDateTime(‘[%CurrentDateTime%]’, “yyyy/MM/dd HH:mm:ss”)

If you need this for calculating difference between datetime1 anddatetime2: secondsBetween($Date1, $Date2)

Or do you need it for something else?

answered
1

I have resolved this issue, I changed the json primitive type of the date to be a string and used formateDateTime to convert it to the format ‘1987-12-31T23:59:00’ all good now.

answered
0

Hi Tim, thank you for your response.

I'm getting the date value from a basic date and time attribute on a page. I then use a json structure and an export mapping to export this to a DateTime attribute. My export mapping produces the following for the datetime value in the request body: "inceptionDate":"2021-03-15T00:00:00.000Z"

However in this mapping I don't want to send the milliseconds. Do you know how I can resolve this?

Many thanks.

answered