• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP find_day_in_month函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中find_day_in_month函数的典型用法代码示例。如果您正苦于以下问题:PHP find_day_in_month函数的具体用法?PHP find_day_in_month怎么用?PHP find_day_in_month使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了find_day_in_month函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: dst_changes_for_year

/**
 * Calculates the required DST change and returns a Timestamp Array
 *
 * @package core
 * @category time
 * @uses HOURSECS
 * @uses MINSECS
 * @param int|string $year Int or String Year to focus on
 * @param object $timezone Instatiated Timezone object
 * @return array|null Array dst => xx, 0 => xx, std => yy, 1 => yy or null
 */
function dst_changes_for_year($year, $timezone) {

    if ($timezone->dst_startday == 0 && $timezone->dst_weekday == 0 &&
        $timezone->std_startday == 0 && $timezone->std_weekday == 0) {
        return null;
    }

    $monthdaydst = find_day_in_month($timezone->dst_startday, $timezone->dst_weekday, $timezone->dst_month, $year);
    $monthdaystd = find_day_in_month($timezone->std_startday, $timezone->std_weekday, $timezone->std_month, $year);

    list($dsthour, $dstmin) = explode(':', $timezone->dst_time);
    list($stdhour, $stdmin) = explode(':', $timezone->std_time);

    $timedst = make_timestamp($year, $timezone->dst_month, $monthdaydst, 0, 0, 0, 99, false);
    $timestd = make_timestamp($year, $timezone->std_month, $monthdaystd, 0, 0, 0, 99, false);

    // Instead of putting hour and minute in make_timestamp(), we add them afterwards.
    // This has the advantage of being able to have negative values for hour, i.e. for timezones
    // where GMT time would be in the PREVIOUS day than the local one on which DST changes.

    $timedst += $dsthour * HOURSECS + $dstmin * MINSECS;
    $timestd += $stdhour * HOURSECS + $stdmin * MINSECS;

    return array('dst' => $timedst, 0 => $timedst, 'std' => $timestd, 1 => $timestd);
}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:36,代码来源:moodlelib.php


示例2: get_user_preferences

 case 'weeknext':
     $startweekday = get_user_preferences('calendar_startwday', CALENDAR_STARTING_WEEKDAY);
     $startmonthday = find_day_in_month($now['mday'] + 1, $startweekday, $now['mon'], $now['year']);
     $startmonth = $now['mon'];
     $startyear = $now['year'];
     if ($startmonthday > calendar_days_in_month($startmonth, $startyear)) {
         list($startmonth, $startyear) = calendar_add_month($startmonth, $startyear);
         $startmonthday = find_day_in_month(1, $startweekday, $startmonth, $startyear);
     }
     $timestart = make_timestamp($startyear, $startmonth, $startmonthday);
     $endmonthday = $startmonthday + 7;
     $endmonth = $startmonth;
     $endyear = $startyear;
     if ($endmonthday > calendar_days_in_month($endmonth, $endyear)) {
         list($endmonth, $endyear) = calendar_add_month($endmonth, $endyear);
         $endmonthday = find_day_in_month(1, $startweekday, $endmonth, $endyear);
     }
     $timeend = make_timestamp($endyear, $endmonth, $endmonthday) - 1;
     break;
 case 'monthnow':
     $timestart = make_timestamp($now['year'], $now['mon'], 1);
     $timeend = make_timestamp($now['year'], $now['mon'], calendar_days_in_month($now['mon'], $now['year']), 23, 59, 59);
     break;
 case 'monthnext':
     list($nextmonth, $nextyear) = calendar_add_month($now['mon'], $now['year']);
     $timestart = make_timestamp($nextyear, $nextmonth, 1);
     $timeend = make_timestamp($nextyear, $nextmonth, calendar_days_in_month($nextmonth, $nextyear), 23, 59, 59);
     break;
 case 'recentupcoming':
     //Events in the last 5 or next 60 days
     $timestart = time() - 432000;
开发者ID:veritech,项目名称:pare-project,代码行数:31,代码来源:export_execute.php



注:本文中的find_day_in_month函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP find_dhcp6c_process函数代码示例发布时间:2022-05-15
下一篇:
PHP find_core_update函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap