Re: mktime to subtract minutes (was Time without seconds )
| From: | Jason Wong | Date: | Wed, 18 Jun 2003 11:42:34 +0000 |
| Subject: | Re: mktime to subtract minutes (was Time without seconds ) | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-28713@lists.php.net to get a copy of this message | ||
On Wednesday 18 June 2003 17:21, Lisi wrote:
> That's what I tried, but when the minutes are less than 40 it doesn't work
> I guess because you get negative. Actually, I'm not sure it even workied
> for the one that was more than 40. Is there a way to do taking into account
> hours as well without having to code by hand "if minutes < 40 " ... etc.?
> Maybe I shouldn't be dealing with hours and minutes separately.
Not sure what you're trying to do, but try
$time = mktime ($hour,$minute - $offset,0,1,1,2003);
where $offset can be any number of minutes, mktime() will take care of the
necessary calculations for you.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
------------------------------------------
/*
poverty, n.:
An unfortunate state that persists as long
as anyone lacks anything he would like to have.
*/