WordPress.org

Ready to get started?Download WordPress

Forums

Printing date as a variable? (3 posts)

  1. skitelluride531
    Member
    Posted 4 years ago #

    Hello!

    I am looking to print the date and multiply it by two. I have following code:

    <?
    $second_number = 2;
    $third_number = the_time('j');
    
    $sum_total = $third_number * $second_number;
    print ($sum_total);
    ?>

    Which seems like it would make sense and work correctly. But instead, it just adds a 0 in front of the data.

    Any ideas?

    Thanks so much

  2. Jonas Grumby
    Member
    Posted 4 years ago #

    What if you use getdate() instead of the_time('j') ?

  3. MichaelH
    Member
    Posted 4 years ago #

    I am looking to print the date and multiply it by two.

    Using Feb 25, 2010 as an example, what result are you expecting if you multiply that date 02/25/2010 by 2?

Topic Closed

This topic has been closed to new replies.

About this Topic