thendal
Programmer
- Aug 23, 2000
- 284
Hi there!!!
I'm wondering is there any easy way to add or manipulate time in the built-in time function.
In the code below if i add $sec=$sec + 10; then if its greater than 60 seconds increase the minutes by one and if the minutes is greater than 60 then increase the hour by one. on and on ...so i'm wondering is there any easy way to add minutes and hours in the time function.
Thanks.
I'm wondering is there any easy way to add or manipulate time in the built-in time function.
In the code below if i add $sec=$sec + 10; then if its greater than 60 seconds increase the minutes by one and if the minutes is greater than 60 then increase the hour by one. on and on ...so i'm wondering is there any easy way to add minutes and hours in the time function.
Thanks.
$time=time();
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =localtime($time);
$year += 1900;
$month=$mon + 1;