Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PHP - date compared with today

LEGEND ,
Aug 16, 2006 Aug 16, 2006
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
TOPICS
Server side applications
254
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 16, 2006 Aug 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 16, 2006 Aug 16, 2006
LATEST
Joe Makowiec wrote:

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

Great - thank you!

Carl

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines