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.
Helpers\Date的更多相关文章
- Config
Config Config App Auth Cache Database Languages Mail Modules Routing Session Config Settings for the ...
- Handlebars块级Helpers
1.Handlebars简单介绍: Handlebars是JavaScript一个语义模板库,通过对view和data的分离来快速构建Web模板.它采用"Logic-less templat ...
- ios开发分类--NSDate+Helpers
#import <Foundation/Foundation.h> @interface NSDate (Helpers) @end #import "Date.h" ...
- Helpers\TableBuilder
Helpers\TableBuilder Table builder helper is a class that would help you to create tables in MySQL ( ...
- (转)MVC语法-@helpers和@functions(Razor内定义函数)
(转)MVC语法-@helpers和@functions(Razor内定义函数) 转自:http://www.mikesdotnetting.com/Article/173/The-Differenc ...
- 3.12 Templates -- Wrting Helpers(编写辅助器)
一.概述 1. Helpers允许你向你的模板添加超出在Ember中开箱即用的额外的功能.辅助器是最有用的,用于将来自模型和组件的原始值转换成更适合于用户的格式. 2. 例如,假设我们有一个Invoi ...
- Yii2 yii\helpers\ArrayHelper
yii\helpers\ArrayHelper 是一个数组辅助类,提供额外的数组功能函数 toArray($object, $properties = [], $recursive = true) C ...
- The Difference Between @Helpers and @Functions In WebMatrix
from: http://www.mikesdotnetting.com/article/173/the-difference-between-helpers-and-functions-in-web ...
- js 函数的防抖(debounce)与节流(throttle) 带 插件完整解析版 [helpers.js]
前言: 本人纯小白一个,有很多地方理解的没有各位大牛那么透彻,如有错误,请各位大牛指出斧正!小弟感激不尽. 函数防抖与节流是做什么的?下面进行通俗的讲解. 本文借鉴:h ...
随机推荐
- POJ 2481-Cows(BIT)
题意: n个牛,每个牛对应一个区间,对于每个牛求n个区间有几个包含该牛的区间. 分析: 先 区间右边界从大到小排序,相同时左边界小到大,统计第i头牛即左边界在前i-1头左边界的正序数. #includ ...
- .NET在WebForm里实现类似WinForm里面TrackBar控件的效果(AJAX Control Toolkit的使用)
WinForm 里面有一个 TrackBar 控件,表示一个标准的 Windows 跟踪条,是类似于 ScrollBar 控件的可滚动控件.用这个控件可以实现很多可以实时调整的功能,比如最常见的音量调 ...
- North America Qualifier (2015)
https://icpc.baylor.edu/regionals/finder/north-america-qualifier-2015 一个人打.... B 概率问题公式见代码 #include ...
- 2015上海网络赛 A Puzzled Elena
题意:给定一棵树,求这个节点的所有子树中包括他本身与它互质的节点的个数. 解题思路:题利用dfs序+容斥原理+前缀和性质解决.题目中要求每个结点,和多少个它的子结点互素.如果每次为了求一个点去跑一遍d ...
- linux C编程之makefile
目的: 基本掌握了 make 的用法,能在Linux系统上编程.环境: Linux系统,或者有一台Linux服务器,通过终端连接.一句话:有Linux编译环境.准备: ...
- git python
GitPython 1.0.2 : Python Package Index gitpylib 0.2.1 : Python Package Index python - How to checkou ...
- ClassLoader, JavaAgent, Aspectj Weaving一站式扫盲帖
最近工作里复习的Class Loader基础知识集锦,写下来希望对别人有帮助,而且不止是为了撂倒面试官. 为了尽量简单明了容易背,有些部分写得比较干. 0. 参考资料: 书:<深入了解Java虚 ...
- EDM
今天,夏令营需要发推广EDM. 之前的edm都是文字版, 今天摸索了一下,简单写了些码, 效果还不错. 演示:http://baike.baidu.com/cms/s/bkcampus/summerc ...
- soliworks三维机柜布局(二)创建设备位置
首先声明对三维机柜布局来说,此步骤不是必须的.(创建solidworks装配体文件时,若是创建了位置就可以选择是否为每个位置创建一个装配体,没有创建位置的话只能选择创建整个工程的装配体文件) 在菜单栏 ...
- [OC Foundation框架 - 11] NSMutableDictionary
void dicUse() { NSMutableDictionary *dic = [NSMutableDictionary dictionary]; Student *stu1 = [Stud ...