Title: Printing date as a variable?
Last modified: August 19, 2016

---

# Printing date as a variable?

 *  [skitelluride531](https://wordpress.org/support/users/skitelluride531/)
 * (@skitelluride531)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/printing-date-as-a-variable/)
 * 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

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Jonas Grumby](https://wordpress.org/support/users/ss_minnow/)
 * (@ss_minnow)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/printing-date-as-a-variable/#post-1403181)
 * What if you use `getdate()` instead of `the_time('j')` ?
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/printing-date-as-a-variable/#post-1403193)
 * > 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?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Printing date as a variable?’ is closed to new replies.

## Tags

 * [date](https://wordpress.org/support/topic-tag/date/)
 * [Math](https://wordpress.org/support/topic-tag/math/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [the_time](https://wordpress.org/support/topic-tag/the_time/)
 * [variable](https://wordpress.org/support/topic-tag/variable/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/printing-date-as-a-variable/#post-1403193)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
