Re: date prob. subtracting days
| From: | Jason Wong | Date: | Mon, 19 May 2003 09:47:03 +0000 |
| Subject: | Re: date prob. subtracting days | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148143@lists.php.net to get a copy of this message | ||
On Monday 19 May 2003 16:17, Merlin wrote:
> I want to subtract todays date from a date in the past and know if this
> date is more than 14 days back. Somehow I am lost in the date, timestamp,
> mktime joungle :-) So far I do get the days back, but only if they are in
> the same month. It just takes care of the day, not of month and year. I
> know that this could be easily done with mysql functions, but in this case
> I need to do them in php after getting the whole dataset.
If you don't want to use mysql's built-in date functions (you ought to),
convert both dates to unix-timestamps then subtract and compare.
--
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-general
------------------------------------------
/*
Victory uber allies!
*/