Re: subtract 1 day
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: subtract 1 day

From: Andy Jeffries <news@andyjeffries.co.uk>
Date: Mon Apr 03 2006 - 10:22:07 CEST

On Mon, 03 Apr 2006 08:06:55 +0000, meltedown wrote:
> I can't see what I'm doing wrong. I'm subtracting 60*60*24 from a unix
> time stamp and the result is 23 hours earlier, not 24. Start with a unix
> time stamp:

Try doing this instead:

$unixtime2 = strtotime("-1 day", $unixtime);

I couldn't see what you were doing wrong in your code from a quick glance,
but the above way is easier to read anyway.

Cheers,

Andy

-- 
Andy Jeffries MBCS CITP ZCE   | gPHPEdit Lead Developer
http://www.gphpedit.org       | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
Received on Mon May 1 02:47:01 2006