Title: configuring the timestamp within a plugin&#8217;s function
Last modified: August 18, 2016

---

# configuring the timestamp within a plugin’s function

 *  [amory](https://wordpress.org/support/users/amory/)
 * (@amory)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/configuring-the-timestamp-within-a-plugins-function/)
 * I’m developing a widget for WP-Dash that will display all upcoming concerts (
   the scheduled entries div from the existing dashboard) and need help configuring
   the timestamp.
 * Here is the main output code:
    `$output .= "<li><a href='post.php?action=edit&
   amp;post=$post->ID' title='edit this post'>$post->post_title</a> on $post->post_date
   </li>";` For now I have the `$post->post_date` because it has been the only thing
   to actually work. I would like to be able to configure it to display as a php
   date format such as `('m/d/Y')`

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

 *  [Joshua Sigar](https://wordpress.org/support/users/alphaoide/)
 * (@alphaoide)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/configuring-the-timestamp-within-a-plugins-function/#post-243273)
 * If you do …
    `setup_postdata( $post )` ..beforehand, you could, then do… `the_date('
   m/d/Y' )`
 *  [viper007bond](https://wordpress.org/support/users/viper007bond/)
 * (@viper007bond)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/configuring-the-timestamp-within-a-plugins-function/#post-243277)
 * Would `date('m/d/y', $post->post_date);` not work?
 * And a lot easier solution to this is to just make a copy of the “Recent Posts”
   widget (`dashboard-recent-posts.php`) and edit the post query to something like:
 * `SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_status = 'publish'
   AND post_date_gmt > '$today' ORDER BY post_date ASC LIMIT 10`
 * That’ll list out up to the 10 soonest posts from the future with the soonest 
   first.
 * Then just change the function names and the `make_widget_available` part at the
   bottom and you’re good to go.
 *  Thread Starter [amory](https://wordpress.org/support/users/amory/)
 * (@amory)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/configuring-the-timestamp-within-a-plugins-function/#post-243282)
 * Thanks for the replies, I’ll try in the morning. [@viper](https://wordpress.org/support/users/viper/)–
   i’m looking to display the date as well as sort by it so the second part is already
   taken care of.
 * Thanks
 *  [viper007bond](https://wordpress.org/support/users/viper007bond/)
 * (@viper007bond)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/configuring-the-timestamp-within-a-plugins-function/#post-243284)
 * That is ordered by date and adding the date would be easy, but whatever. 🙂
 *  Thread Starter [amory](https://wordpress.org/support/users/amory/)
 * (@amory)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/configuring-the-timestamp-within-a-plugins-function/#post-243377)
 * Sorry – long night last night… I meant that the upcoming posts are already sorted,
   and just need timestamps per each. With the `date()` function, the timestamps
   for each are 12/31/1969.
 * Code with `the_time()` – [http://paste.uni.cc/7556](http://paste.uni.cc/7556)
   
   Code with `date()` – [http://paste.uni.cc/7555](http://paste.uni.cc/7555)

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

The topic ‘configuring the timestamp within a plugin’s function’ is closed to new
replies.

 * 5 replies
 * 3 participants
 * Last reply from: [amory](https://wordpress.org/support/users/amory/)
 * Last activity: [20 years, 10 months ago](https://wordpress.org/support/topic/configuring-the-timestamp-within-a-plugins-function/#post-243377)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
