I am getting a JSON response with value of time like this from Amazon:
"Duration":
{
"name": "Duration",
"value": "PT7H"
}
That stands for 7 hours. If the input is 5 minutes then it will be like this:
"Duration":
{
"name": "Duration",
"value": "PT5M"
}
How can I convert the PT5M to time in seconds? So, if the string is "PT5M" (which is 300 seconds) then I want it to be 300
as the output.
Thanks!