本文整理匯總了PHP中TimeDate::getMonthName方法的典型用法代碼示例。如果您正苦於以下問題:PHP TimeDate::getMonthName方法的具體用法?PHP TimeDate::getMonthName怎麽用?PHP TimeDate::getMonthName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TimeDate
的用法示例。
在下文中一共展示了TimeDate::getMonthName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getDateFromRules
/**
* function getDateFromRules($year, $startMonth, $startDate, $weekday, $startTime )
* Converts the rules for a timezones dst into a string representation of a date for the given year
*
* @param STRING(YEAR) $year
* @param INT(MONTH INDEX) $startMonth
* @param INT(DATE INDEX) $startDate
* @param INT(WEEKDAY INDEX) $weekday
* @param INT(START TIME IN SECONDS) $startTime
* @return unknown
*/
function getDateFromRules($year, $startMonth, $startDate, $weekday, $startTime)
{
if ($weekday < 0) {
return date('Y-m-d H:i:s', strtotime("{$year}-{$startMonth}-{$startDate}") + $startTime);
}
$dayname = TimeDate::getWeekDayName($weekday);
if ($startDate > 0) {
$startMonth--;
}
$month = TimeDate::getMonthName($startMonth);
$startWeek = floor($startDate / 7);
//echo "$startWeek week $dayname - $month 1, $year<br>";
return date('Y-m-d H:i:s', strtotime("{$startWeek} week {$dayname}", strtotime("{$month} 1, {$year}")) + $startTime);
}