Title: date functions?
Last modified: August 18, 2016

---

# date functions?

 *  [RobotHero](https://wordpress.org/support/users/robothero/)
 * (@robothero)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/date-functions/)
 * I want to post a whole bunch of posts, one per week. So I’ve added a special 
   postweek.php and a corresponding edit-formweek.php to the admin menu.
 * edit-formweek chooses the default date using this code:
    `$max_date = ($wpdb-
   >get_var("SELECT MAX(post_date) FROM $wpdb->posts"));`
 * Which gives me the date of the last post. What I want it to default to, however,
   is the last post plus seven days.
 * Are there any date functions that will do this?

Viewing 1 replies (of 1 total)

 *  Thread Starter [RobotHero](https://wordpress.org/support/users/robothero/)
 * (@robothero)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/date-functions/#post-171761)
 * function rrh_add_days ($date, $days){
 *  $days_adj = strtotime($date) + $days * 3600 * 24;
    $date = date(‘Y-m-d H:i:s’,
   $days_adj); return $date; }

Viewing 1 replies (of 1 total)

The topic ‘date functions?’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [RobotHero](https://wordpress.org/support/users/robothero/)
 * Last activity: [21 years, 1 month ago](https://wordpress.org/support/topic/date-functions/#post-171761)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
