Re: Date data type problem
| From: | Joe Stump | Date: | Mon, 15 Jan 2001 14:57:16 +0000 |
| Subject: | Re: Date data type problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-34629@lists.php.net to get a copy of this message | ||
This is not possibly - do this on $date2 first:
$foo_date2 = str_replace('-',$foo_date2);
then
if($date1 < $foo_date2)
{
}
else
{
}
--Joe
On Mon, Jan 15, 2001 at 03:15:38PM -0600, Jacky@lilst wrote:
> Hi people,
> I have tried to compare 2 date values to see if one come before another using the sniplet
> below:
>
> if ($date1 < $date2) {
> do something
> }else{
> .......
> }
>
> while $date1 is in "yyyymmdd" format but $date2 is in "yyyy-mm-dd" formate
> because I get value of $date2 from a "date" data type field from a table.
> Can I use this "yyyy-mm-dd" to compare with value from another date variabile in the
> "yyyymmdd" format? If not possible, How do I make both of them to be in the same format?
> cheers
> Jack
> jacky@activelifestyle.com
> "There is nothing more rewarding than reaching the goal you set for yourself"
--
Joe Stump, PHP Hacker
joestump98@yahoo.com
http://www.miester.org/