Re: date question

From: Date: Sun, 29 Sep 2002 14:27:36 +0000
Subject: Re: date question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-118074@lists.php.net to get a copy of this message
Not sure why you need the 5 days in advance bit, but this might give you the tools to work it all out. I prefer to work with dates in unix timestamp format (seconds). To get "now", use time() To get "next month", there's a kewl function called strtotime(), which converts english phrases into timestamps... eg strtotime("+1 month") might do the job, or "next month"... experiment, use the manual, etc etc To get "now - 5 days" either use strtotime("-5 days") or <? $nowMinus5days = time() - 432000; // 432000 = 5x24x60x60 $nowMinus5days = date('d/m/y', $nowMinus5days); ?> Hope this helps, Justin on 29/09/02 3:04 PM, Jonas Geiregat (kemu@sdf-eu.org) wrote: > I have a date ex 24/08/02 > and I need to see if that date is the same date as it is today (only one > month later) but 5day's in advanced => that would be 24/09/02 > so if(date == date now - 5) > {true} > else{false} > > how can I do this right ? >

« previous php.general (#118074) next »