Re: A pluggin to convert second in H:M:S
| From: | Tom Sommer | Date: | Tue, 25 Feb 2003 16:57:51 +0000 |
| Subject: | Re: A pluggin to convert second in H:M:S | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8192@lists.php.net to get a copy of this message | ||
On 25 Feb 2003 08:35:44 +0100, Juzan Jean-Michel wrote:
> function smarty_function_gethms($params, &$smarty)
> {
> extract($params);
> $hours = floor($secondes / 3600);
> $minute = floor(($secondes - ($hours * 3600)) / 60);
> $secconde = $secondes - ($hours * 3600) - ($minute * 60);
>
> echo sprintf("%02d", $hours).".".sprintf("%02d",
> $minute).".".sprintf("%02d", $secconde);
> }
> ?>
Why not also days, months, years ?
--
Tom Sommer, denmark
www.tsn.dk - www.dreamcoder.dk