RE: [PHP] unix timestamp

From: Date: Fri, 06 Sep 2002 11:40:49 +0000
Subject: RE: [PHP] unix timestamp
Groups: php.general 
Request: Send a blank email to php-general+get-115439@lists.php.net to get a copy of this message
Hi Andy, > I am trying to create a unix timestamp which dates back > a certain amount of days. Lets say I would like to have > a unix timestamp from 7 days ago. > what I tryed is just to subtract values since this are > counted s since the start of the unix epoche, but this > does not work in cases like the switch of months. A quick and dirty way is to subtract 86400 from the current timestamp to push it back one day, so it would be (7*86400)=604800 for a week. This isn't the best method though - you should be able to do calculations within mktime(). If you post the code you tried we can have a look. Cheers Jon

« previous php.general (#115439) next »