Title: Date Formatting
Last modified: August 18, 2016

---

# Date Formatting

 *  [shelaghg](https://wordpress.org/support/users/shelaghg/)
 * (@shelaghg)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/date-formatting/)
 * I want to extract some data from my WP db but the data isn’t being used in a 
   wordpress template so I can’t use WP tags. I want to use the post_date value 
   from wp_posts but it comes out “2004-03-13 17:28:38” and this isn’t the formatting
   I want. This is the code I’m using :
    `$post_date=$myrow["post_date"];` How do
   I apply date formatting to it so it looks like “13/03/04”. BTW, I don’t want 
   the formatting I just want to know how to apply it. Thanks

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

 *  [codergurl](https://wordpress.org/support/users/codergurl/)
 * (@codergurl)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/date-formatting/#post-75976)
 * $post_date = date(‘date_format_here’, strtotime($post->post_date));
 *  [Root](https://wordpress.org/support/users/root/)
 * (@root)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/date-formatting/#post-75999)
 * Go into admin / options.
 *  Thread Starter [shelaghg](https://wordpress.org/support/users/shelaghg/)
 * (@shelaghg)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/date-formatting/#post-76007)
 * Root – the whole point of the question is that I’m not using the data in WordPress!
   
   codergurl – that seems on the right track but it displays all the dates as 07/
   25/2004 12:00:00 AM !
 *  Thread Starter [shelaghg](https://wordpress.org/support/users/shelaghg/)
 * (@shelaghg)
 * [21 years, 10 months ago](https://wordpress.org/support/topic/date-formatting/#post-76010)
 * codergurl – the following worked :
    `$post_date = date('m/d/Y h:i:s A', strtotime(
   $myrow["post_date"]));` Thanks for putting me on to strtotime – that was just
   what I needed 🙂

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

The topic ‘Date Formatting’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [shelaghg](https://wordpress.org/support/users/shelaghg/)
 * Last activity: [21 years, 10 months ago](https://wordpress.org/support/topic/date-formatting/#post-76010)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
