我发现这个PHP代码归功于创建者,并希望以不同的方式实现它:
目标是让代码自动将以下语句调整为从现在到永恒的每个月的第二个星期六:
如:" 2011年2月12日星期六,上午11点到中午."
我不是PHP大师,有人可以编辑它来工作吗?
<?php
function nextMeeting($nextMonth = false) {
$day=date("j");
$month=date("n");
$year=date("Y");
if ($nextMonth) {
$day=1;
if ($month == 12) {
$month=1;
$year++;
} else {
$month++;
}
}
$dayofweek=date("w");
$firstOfMonth=date("w",mktime(0, 0, 0, $month , 1, $year ));
// figure out what date is the second Saturday of the month
if ( $firstOfMonth > 0 ) {
$firstSunday= 8 - $firstOfMonth;
} else {
$firstSunday= 1;
}
$firstSundayDate=date("D",mktime(0, 0, 0, $month , …Run Code Online (Sandbox Code Playgroud) 我需要网站的Javascript代码来自动调整日期.目标是让代码自动将以下语句调整为从现在到永恒的每个月的第二个星期六:
有人有想法吗?非常感激!