Mateobus Posted March 14, 2007 Share Posted March 14, 2007 is there a way to calculate the 3rd monday of september for a given year with php? Any help is appreciated. Link to comment https://forums.phpfreaks.com/topic/42605-3rd-monday-of-september/ Share on other sites More sharing options...
kenrbnsn Posted March 14, 2007 Share Posted March 14, 2007 Use the strtotime() function: <?php echo '<br>The third Monday in September, 2007 is ' . date('l, F jS, Y',strtotime('third monday',strtotime('2007-09-01'))); ?> Note: in my testing of this, it got the 3rd Monday of September 2008 wrong, but other years were right. Ken Link to comment https://forums.phpfreaks.com/topic/42605-3rd-monday-of-september/#findComment-206756 Share on other sites More sharing options...
Mateobus Posted March 14, 2007 Author Share Posted March 14, 2007 works for me, thanks Link to comment https://forums.phpfreaks.com/topic/42605-3rd-monday-of-september/#findComment-206781 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.