Helpers\Date

The Date helper is used for calculations with dates.

Date::difference($from, $to, $type = null)

$from, $to - from and to date in the format: YYYY-MM-DD HH:MM::SS

$type - default to null will return an array containing:

[y] => 0
[m] => 2
[d] => 26
[h] => 0
[i] => 0
[s] => 0
[weekday] => 0
[weekday_behavior] => 0
[first_last_day_of] => 0
[invert] => 1
[days] => 86
[special_type] => 0
[special_amount] => 0
[have_weekday_relative] => 0
[have_special_relative] => 0

to return a set item like the number of days pass d as the third parameter.

Date::businessDays($startDate, $endDate, $weekendDays = false)

Get the number of days between 2 dates, set $weekendDays to true to get the number of weekends.

Date::businessDates($startDate, $endDate, $nonWork = 6)

Get an array of dates between 2 dates (not including weekends). $nonWork day of week(int) where weekend begins - 5 = fri -> sun, 6 = sat -> sun, 7 = sunday

Date::daysInMonth($month = 0, $year = '')

Takes a month/year as input and returns the number of days for the given month/year. Takes leap years into consideration.

最新文章

  1. Robot Framework 的安装和配置(转载)
  2. HBase Java简单示例
  3. finereport普通报表的移动端自适应方案
  4. Hibernate双向多对多对象关系模型映射
  5. 【转】SVN管理多个项目版本库
  6. iOS应用之间跳转
  7. [BS-14] 打印NSArray和NSDictionary的3种方法
  8. Git 分支管理是一门艺术
  9. css选择器,用来处理隔行变色的表格
  10. Unieap3.5-禁用Form表单中的全部标签
  11. Arcgis Engine - 鹰眼(减少闪烁)
  12. UVALive3516Exploring Pyramids(dp)
  13. testNG常用方法
  14. 如何处理JS,css与smarty标签的冲突
  15. 百度地图API实时画出动态运行轨迹(一条行驶轨迹),车头实时指向行驶方向,设置角度偏移
  16. (转)Spring Boot 2 (六):使用 Docker 部署 Spring Boot 开源软件云收藏
  17. EasyUI datagrid columns 中 field 区分大小写
  18. mysql如何出查出最近7天,最近30天,最近n天的记录?
  19. 使用git上传项目到码云
  20. UNIX环境编程学习笔记(19)——进程管理之fork 函数的深入学习

热门文章

  1. EF的表连接方法Include() - nlh774
  2. HDU4612 Warm up 边双(重边)缩点+树的直径
  3. Loadrunner通过sitescope监控mysql
  4. 无状态、REST、RESTful 和 Web Services【整理】
  5. 单点登录与消息队列以及在J2EE中的实现方案
  6. python 使用__future__
  7. RC522天线匹配参数【worldsing笔记】
  8. android中常用的尺寸单位及其关系
  9. 关于local storage 和 session storage以及cookie 区别简析
  10. Android 命名规范和编码规范