>From http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
(first comment)
SELECT SEC_TO_TIME( SUM( TIME_TO_SEC( `time` ) ) ) AS total_time FROM
time_table;

So you should be able to add a "fields" to your search where you put
the above MySQL trick. You may also want to add a "GROUP BY" to
automatically group the data by the name of the process.

If you want to (or have to) do it in php then loop the array. You can
either split the string and add the minutes and possible hours using a
factor of 60 an 3600. But I would opt to at least let MySQL calculate
TIME_TO_SEC() so I would have something numeric to work with.




On Jan 22, 3:14 am, Mr Chaz <[email protected]> wrote:
> $apps = $this->Application->find('all', array('conditions' => array
> ('Application.Username' => $username, 'Application.Duration !=' =>
> null)));
>
>                 debug ($qwe = Set::combine($apps,
> '{n}.Application.id','{n}.Application.Duration',
> '{n}.Application.ProcessDescription'));
>
> Array
> (
>     [Google Talk] => Array
>         (
>             [2] => 00:00:09
>             [16] => 00:00:37
>             [23] => 00:00:14
>             [25] => 00:01:11
>             [181] => 00:00:13
>             [182] => 00:00:11
>             [183] => 00:00:01
>             [184] => 00:00:09
>             [185] => 00:00:02
>             [186] => 00:00:14
>             [187] => 00:00:09
>             [188] => 00:00:09
>             [189] => 00:01:12
>             [190] => 00:00:04
>             [191] => 00:00:15
>             [500] => 00:00:20
>             [501] => 00:00:03
>             [502] => 00:10:23
>             [504] => 00:00:18
>             [506] => 00:00:01
>             [508] => 00:06:00
>             [630] => 00:00:05
>             [633] => 00:00:01
>         )
>
>     [AVG Update downloader] => Array
>         (
>             [3] => 00:00:27
>             [123] => 00:00:01
>         )
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to