• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
PHP开发记录
PHP以及web前端(ajax,js,jquery等)
博客园 首页 新随笔 管理

08 2011 档案

 
计算一段日期内的周末天数(星期六,星期日总和
摘要:function get_weekend_days($start_date,$end_date){ if (strtotime($start_date) > strtotime($end_date)) list($start_date, $end_date) = array($end_date, $start_date); $start_reduce = $end_add = 0; $start_N = date('N',strtotime($start_date)); $start_reduce = ($start_N == 7) ? 1 : 0; $end_N = d 阅读全文
posted @ 2011-08-29 08:58 corange 阅读(430) 评论(0) 推荐(0)
根据指定两个日期计算出这些时间内有多少天是周末 php程序函数代码
摘要:$alldays = intval((sstrtotime($_POST['dayb']) - sstrtotime($_POST['daya'])) / 3600 / 24) + 1; //总天数 $weeks = intval($alldays / 7); //纯周数 $mdays = $alldays - 7 * $weeks; //除了纯周数外,余下那周的天数 if($mdays == '0') { $_POST['psdays'] = 5 * $weeks; $_POST['zmdays'] = 2 * 阅读全文
posted @ 2011-08-10 10:16 corange 阅读(497) 评论(0) 推荐(0)
计算一段日期内的周末天数(星期六,星期日总和)(
摘要:function get_weekend_days($start_date,$end_date){ if (strtotime($start_date) > strtotime($end_date)) list($start_date, $end_date) = array($end_date, $start_date); $start_reduce = $end_add = 0; $start_N = date('N',strtotime($start_date)); $start_reduce = ($start_N == 7) ? 1 : 0; $end_N = d 阅读全文
posted @ 2011-08-08 22:27 corange 阅读(698) 评论(0) 推荐(0)
 

公告


博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3