That solution is like walking over the river to get water.
-Original Message-
From: Meteorlet Woody
To: php-windows
Sent: 17-2-2004 1:44
Subject: Re: [PHP-WIN] Convert time
Harpreet,Hello!
Another easy way like this:
$min = Date('i', mktime(0, 0, $totsec,
Harpreet,Helloļ¼
Another easy way like this:
$min = Date('i', mktime(0, 0, $totsec, 0, 0, 2004));
$sec = Date('s', mktime(0, 0, $totsec, 0, 0, 2004));
May this helps,
Meteorlet Woody
=== 2004-02-17 00:35:40 ===
>
>I am trying to add time. If my seconds or minutes
>> Jesus "$min = $sec % 60 60;" should be "$sec = $sec % 60;"
> Maybe $sec = min % 60 ;) ?
No it should not be, think again why.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello B.A.T.,
Monday, February 16, 2004, 8:01:30 PM, you wrote:
SBATH> On Mon, 2004-02-16 at 17:46, Svensson, B.A.T. (HKG) wrote:
>> Example:
>>
>> $min = (int)($sec/60);
>> $min = $sec % 60;
>>
SBATH> Jesus "$min = $sec % 60 60;" should be "$sec = $sec % 60;"
SBATH> I'll have a lo
On Mon, 2004-02-16 at 17:46, Svensson, B.A.T. (HKG) wrote:
> Example:
>
> $min = (int)($sec/60);
> $min = $sec % 60;
>
Jesus "$min = $sec % 60 60;" should be "$sec = $sec % 60;"
I'll have a lot of funny bugs to behold in my code tomorrow
--
PHP Windows Mailing List (http://www.
lol
-Original Message-
From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
Sent: 16 February 2004 4:49
To: php-windows
Subject: Re: [PHP-WIN] Convert time
On Mon, 2004-02-16 at 17:46, Svensson, B.A.T. (HKG) wrote:
> There might be also a floor function you can instead of cast
On Mon, 2004-02-16 at 17:46, Svensson, B.A.T. (HKG) wrote:
> There might be also a floor function you can instead of casting, but of
> that I know nothing (read: I didn't search the man pages).
"There might also exist a floor function which you can use instead[...]"
time to leave work.
--
PHP is typeless and will convert your left hand operand to the type
returned by your right hand expression. You can deal with this by
casting the right hand expression to an integer when computing the
minutes. To compute the seconds, you better use the modulus operator(%).
Example:
$min = (int)($
I am trying to add time. If my seconds or minutes go over 60 how can i find
the number of minutes or hours.
I am doing something like this
if ($totsec>60)
{
$min=$totsec/60;
$sec=$totsec-$min*60;
}
but i get results in 1.2.
I need integers
Please help
--
PHP Windows Mai