Re: How to Compare Date
| From: | Jack | Date: | Fri, 31 May 2002 05:30:37 +0000 |
| Subject: | Re: How to Compare Date | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-19546@lists.php.net to get a copy of this message | ||
could you tell me how i can covert it to UnixTimeStamp Format?
Thx a lot
Jack
----- Original Message -----
From: "Jason Wong" <phplist@gremlins.com.hk>
Newsgroups: php.db
To: <php-db@lists.php.net>
Sent: Thursday, May 30, 2002 8:32 PM
Subject: Re: [PHP-DB] How to Compare Date
> On Thursday 30 May 2002 20:25, Jack wrote:
> > Dear all
> > I had a Input form for user to input the Leave Record,
> > I want to do some check before the record can insert into database!
> >
> > Here is the problem i had when checking the Leave From Date and Leave To
> > Date.
> > I want to prevent any Leave To Date which is earlier then Leave From
Date.
> > how i can do the comparsion? I had tried to use the following script but
it
> > doesn't work!
> >
> > <?
> > $a=$leave_form
> > $b=$leave_to
> >
> > if ($a<$b)
> > {
> > insert statement
> > }
> >
> > ?>
> >
> > It doesn't work since i use the < Operator!
> >
> > Does anyone know how i can perform this comparsion?
>
> Convert both dates to a UNIXTIMESTAMP then do the comparison.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
>
> /*
> Politics makes strange bedfellows, and journalism makes strange politics.
> -- Amy Gorin
> */
>