Title: the_time() function will not capitalize
Last modified: August 18, 2016

---

# the_time() function will not capitalize

 *  Resolved [ruzel](https://wordpress.org/support/users/ruzel/)
 * (@ruzel)
 * [20 years ago](https://wordpress.org/support/topic/the_time-function-will-not-capitalize/)
 * I would like to display the month in uppercase letters. I figured the easiest
   way to do that would be to use “strtoupper()” Here’s what I’ve got running in
   the index.php template:
 * >  <?php
   >  $tempdate = the_time(‘F’); strtoupper($tempdate); echo($tempdate); ?
   > >
 * Alternately I’ve tried
 * >  <?php
   >  strtoupper(the_time(‘F’)); ?>
 * but no dice.

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

 *  [alrescha](https://wordpress.org/support/users/alrescha/)
 * (@alrescha)
 * [20 years ago](https://wordpress.org/support/topic/the_time-function-will-not-capitalize/#post-395844)
 * You need to use `get_the_time()` instead of `the_time()`. The former will return
   the time as a PHP string, allowing you to manipulate it further, then echo it
   out; the latter echos out the time directly.
 * `echo your_further_manipulation(get_the_time('format string'));`
 * The same goes for many of the other date and time functions.
 *  Thread Starter [ruzel](https://wordpress.org/support/users/ruzel/)
 * (@ruzel)
 * [20 years ago](https://wordpress.org/support/topic/the_time-function-will-not-capitalize/#post-395861)
 * Not sure I understand the need for the difference but I’m sure it has to do with
   variable typing or something I don’t understand–thank you so much!
 *  [alrescha](https://wordpress.org/support/users/alrescha/)
 * (@alrescha)
 * [20 years ago](https://wordpress.org/support/topic/the_time-function-will-not-capitalize/#post-395878)
 * Those WordPress API functions with `get_` prefixes will return a value, while
   their non-`get_` counterparts simply output the value. Think of it this way:
 * `function two_plus_two() { echo 2+2; }
    function get_two_plus_two() { return 
   2+2; }
 * This is the difference. If you skim through the Codex API documentation and compare,
   you’ll see.
 * The need for the difference is exactly to allow what you wanted to do here: to
   further manipulate the returned data, instead of throwing it straight out. Well,
   I’m not a developer so I actually wouldn’t know exactly why they implemented 
   these variations, but _I_ would implement these variations for the said reason.
 *  Thread Starter [ruzel](https://wordpress.org/support/users/ruzel/)
 * (@ruzel)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/the_time-function-will-not-capitalize/#post-396383)
 * alrescha, thanks for that explanation. That was a subtlety in the function names
   that I had not noticed. And I agree with your reasoning, too.

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

The topic ‘the_time() function will not capitalize’ is closed to new replies.

## Tags

 * [capitalize](https://wordpress.org/support/topic-tag/capitalize/)
 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [the_time](https://wordpress.org/support/topic-tag/the_time/)
 * [uppercase](https://wordpress.org/support/topic-tag/uppercase/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [ruzel](https://wordpress.org/support/users/ruzel/)
 * Last activity: [19 years, 3 months ago](https://wordpress.org/support/topic/the_time-function-will-not-capitalize/#post-396383)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
