Helpers\Date

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值