Conditional date: compare with today date
Hi to all,
I’m trying to display a conditional date in my listing artcile sidebar:
If the article date = today date -> display hour.
If the article date != today date -> display date.
Actually, my post title is build like that: <?php the_time(‘d.m’); ?> – <?php the_title(); ?> My PHP
My PHP knowledge are very poor, so I trying with this code:
if(the_date("d.m") == the_time("d.m")) echo the_time("H:i"); else echo the_time("d.m");
Obviously, it doesn’t work… Anyone to help me?
- The topic ‘Conditional date: compare with today date’ is closed to new replies.