wmguk Posted September 3, 2008 Share Posted September 3, 2008 Hi, I am trying to create a little script to simply display: Next Meeting - Wednesday 10th September 2008 but the meetings are every wednesday, so until next tueday I need to show 10th Sept, after tuesday it needs to be the 17th etc etc I currently have <?PHP $newDate = strtotime("+7 day", time()); echo date('jS F Y',$newDate) ; ?> but obviously that will display the day in 7 days... not the next wednesay, is there a way? Link to comment https://forums.phpfreaks.com/topic/122623-showing-dates-for-next-wednesday/ Share on other sites More sharing options...
php_dave Posted September 3, 2008 Share Posted September 3, 2008 Yup you can use "Next Wednesday" as a modifier for the strtotime function. $newDate = strtotime("Next Wednesday", time()); echo date('jS F Y',$newDate); Check out this page for other valid modifiers: http://www.gnu.org/software/tar/manual/html_node/Relative-items-in-date-strings.html#SEC120 Link to comment https://forums.phpfreaks.com/topic/122623-showing-dates-for-next-wednesday/#findComment-633166 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.