Reputation: 410
I want to convert a duration from ISO 8601 format to an integer by computing the number of minute in this duration. For exemple if I have PT1h30M , I want to convert it to 90, because I need to store this inforamtion in my data base as integer (the number of minute). is there any function in PHP to do this?
Upvotes: 0
Views: 2872
Reputation: 2347
There are a few answers out there relating to conversion of ISO 8601 format.
Check out PHP 5.3+ DateInterval
Also, Parse and create ISO 8601 Date and time intervals, like PT15M in PHP
Upvotes: 1