Support » Themes and Templates » Simple PHP Date Math question

  • Hi everybody,

    I want to write someone’s age and I want it to be dynamic. So let’s say Julie is 20 years old. Then Julie is (this year – 1981) years old.

    I manage to do that calculation on WP with the following code:

    <?php $prodid = 2011;
    $second_number = 1991;
    $sum_total = $prodid - $second_number;
    print ($sum_total);
    ?>

    But it’s still not dynamic – I’d like the 2011 to be <?php the_time(‘Y’); ?> but it’s doesn’t work!!! ^
    Can someone help me with this detail?

    [s]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Simple PHP Date Math question’ is closed to new replies.