I have an excel sheet that I am importing but I would like some of the data to be converted down to minutes. Though the formats vary from 5h 5m 6.64s to 6.64s how would i be able to convert this down to only minutes in PHP? (I’m sure DateTime::createFromFormat() wont work as its range is from 0 to 59.)
Also would be converting down to minutes be an easier format to manipulate and graph within a PHP application or converting it to some time object from a PHP class better?
Keep in mind the data has to be formatted, then imported to a MySQL server then read back to a PHP application to graph for statistical purpose. I’m also using cakePHP framework to build the app. Thanks for any feedback.
If the different parts of the string are always separated by a space, you could simply use:
I haven’t tested this, so you’ll need to debug it yourself.