脚本宝典收集整理的这篇文章主要介绍了php – 从2016年3月3日开始每三个星期四回音,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
从2016年3月3日起,他们每三个星期四举行一次董事会会议
我希望在下次会议召开时回应.
这是我到目前为止所得到的,但这不正确.
// ECHO next board_meeting - Use [next_board_meeting] add_shortcode( 'next_board_meeting','next_board_meeting_shortcode' ); function next_board_meeting_shortcode( $str ) { echo date_i18n('l j F',strtotime('next thursday +2 week')); }
如果当前日期已经过了第四个周四那么它将显示下个月的第四个周四..如果当前月份是12月并且已经过了第三个周四那么它将在明年1月的第四个周四显示
<?PHP $current_date = strtotime(date("d.m.Y")); //$final = date("Y-m-d",strtotime("+1 month",$time)); $FullMonth = date('F',$current_date); $FullYear = date('Y',$current_date); $Third_Thus = date('d F Y',strtotime('third thursday of '.$FullMonth.' '.$FullYear)); $ThirdThus_tmstamp = strtotime($Third_Thus); if($current_date <= $ThirdThus_tmstamp){ echo date('d F Y',strtotime('third thursday of '.$FullMonth.' '.$FullYear)); } else{ if($FullMonth != 'December'){ $FullMonth = date('F',$current_date)); $FullYear = date('Y',$current_date); } else{ $Next_Year = strtotime("+1 year",$current_date); $FullYear = date('Y',$Next_Year); $FullMonth = date('F',$Next_Year)); } echo date('d F Y',strtotime('third thursday of '.$FullMonth.' '.$FullYear)); }?>
以上是脚本宝典为你收集整理的php – 从2016年3月3日开始每三个星期四回音全部内容,希望文章能够帮你解决php – 从2016年3月3日开始每三个星期四回音所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。