I'm trying to replace the time value in a JSON file with current time using ROBOT framework, however the time format is in "YYYY-MM-DDTHH:MM:SS.SZ"
and I'm not able to figure that out...
x.json
{
"abc": "123",
"xyz": [ "a1b2c3"],
"time": "2021-02-04T13:01:27.4Z"
}
I want to update it with current time or [current time + 3-5 mins], Let's say current time is 18:00 I need the value in JSON to be 18:05
updated x.json
{
"abc": "123",
"xyz": [ "a1b2c3"],
"time": "2021-02-04T18:05:00.0Z"
}
I tried doing with sed
but it cant change into "YYYY-MM-DDTHH:MM:SS.SZ"
format.
Even date -u
doesn't return in the above format.
Is there a way of doing this using ROBOT + linux commands?