Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

add plus minutes to a date time value with the jolt transform json processor

avatar
Contributor

 

 

Hi all,

I want to add 15 minutes to a date-time value using the transform json processor, but with my configuration I get the same value as before. I expect for the end field to have 15 minutes more than the start field. Does anyone have any idea?

 

[ {
  "store_id" : 1001,
  "date" : 20220918,
  "start" : "2022-09-18 00:15:00",
  "end" : "2022-09-18 00:15:00",
  "out" : 0
}, {
  "store_id" : 1001,
  "date" : 20220918,
  "start" : "2022-09-18 00:30:00",
  "end" : "2022-09-18 00:30:00",
  "out" : 0
}]

 

My jolt Specification

 

[
  {
    "operation": "modify-overwrite-beta",
    "spec": {
     "*":{
           "end": "=${end:toDate('yyyy-MM-dd HH:mm:ss'):toNumber():plus(900000):format('yyyy-MM-dd HH:mm:ss')}"
      }
    }
  }
]

 

The result is the same

 

 

[ {
  "store_id" : 1001,
  "date" : 20220918,
  "start" : "2022-09-18 00:15:00",
  "end" : "2022-09-18 00:15:00",
  "out" : 0
}, {
  "store_id" : 1001,
  "date" : 20220918,
  "start" : "2022-09-18 00:30:00",
  "end" : "2022-09-18 00:30:00",
  "out" : 0
}

 

 

 

2 ACCEPTED SOLUTIONS

avatar
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Contributor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
2 REPLIES 2

avatar
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Contributor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login