In the WPTouch theme, the posting date is displayed in a large bubble. However, posts are added the night before, so the day is behind by one. To fix this, I changed this line:
<?php wptouch_the_time( 'j' ); ?>
to this:
<?php
$date = DateTime::createFromFormat('m-d-Y', mysql2date('m-d-Y', $post->post_date));
$date->modify('+1 day');
echo $date->format('j');
?>
This works, but is crazy ugly. I think there should be a better way to get from mysql date to php DateTime.
You can use this filter to modify the date before it is given to the theme with the function
get_the_date()
(whichwptouch_the_time()
most probably uses to get the date):That being said, instead of modifying the date when it is read from the database, it would be better to just store the publication date when it is written. You can do this by scheduling posts for the next day, instead of publishing them directly.
you can do this
The way i always do this is using the
strtotime
method