Skip to main content
Inspiring
August 16, 2006
Question

PHP - date compared with today

  • August 16, 2006
  • 2 replies
  • 258 views
Hi,

in a mysql-table I have a column (datatype date - 0000-00-00). It is
displayed as

<td><?php echo " ".date('d.m.Y',strtotime($row_rstermin['kaldatum']));
?></td>

I would like to insert a "passed" or something like that after the dates
which are passed. I've tried to work with "< now()" but without success.
What to do?


Regards
Carl
This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Inspiring
August 16, 2006
Joe Makowiec wrote:

> <?php if (strtotime($row_rstermin['kaldatum']) < time()) echo "passed";
> ?>

Great - thank you!

Carl

Inspiring
August 16, 2006
On 16 Aug 2006 in macromedia.dreamweaver.appdev, carl wrote:

> in a mysql-table I have a column (datatype date - 0000-00-00). It is
> displayed as
>
> <td><?php echo "
> ".date('d.m.Y',strtotime($row_rstermin['kaldatum'])); ?></td>
>
> I would like to insert a "passed" or something like that after the
> dates which are passed. I've tried to work with "< now()" but
> without success. What to do?

<?php if (strtotime($row_rstermin['kaldatum']) < time()) echo "passed";
?>

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php