Re: Require some help about the date comparison
| From: | Jason Wong | Date: | Wed, 17 Jul 2002 07:20:59 +0000 |
| Subject: | Re: Require some help about the date comparison | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-108038@lists.php.net to get a copy of this message | ||
On Wednesday 17 July 2002 14:55, Manisha wrote:
> I am writing one program -
>
> I want to display some text on web. This text should appear for limited
> period e.g from 20th July 12pm till 25th July 3pm. After 25th July 3pm the
> text should disappear from screen.
>
> I tried to look for date comparison / string conversion to date etc, I got
> lot info but could not figure out which would be best for above (rather how
> can I do it).
>
> Anybody can share some expert comments please ?
1) Use strtotime() to convert your start and end dates to unixtimestamps.
2) Use time() to get the current unixtimestamp.
3) Use the standard less-than (<), greater-than (>) comparison operators on
the above 3 items to decide whether or not to display the text.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
A chronic disposition to inquiry deprives domestic felines of vital qualities.
*/