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的更多相关文章

  1. Config

    Config Config App Auth Cache Database Languages Mail Modules Routing Session Config Settings for the ...

  2. Handlebars块级Helpers

    1.Handlebars简单介绍: Handlebars是JavaScript一个语义模板库,通过对view和data的分离来快速构建Web模板.它采用"Logic-less templat ...

  3. ios开发分类--NSDate+Helpers

    #import <Foundation/Foundation.h> @interface NSDate (Helpers) @end #import "Date.h" ...

  4. Helpers\TableBuilder

    Helpers\TableBuilder Table builder helper is a class that would help you to create tables in MySQL ( ...

  5. (转)MVC语法-@helpers和@functions(Razor内定义函数)

    (转)MVC语法-@helpers和@functions(Razor内定义函数) 转自:http://www.mikesdotnetting.com/Article/173/The-Differenc ...

  6. 3.12 Templates -- Wrting Helpers(编写辅助器)

    一.概述 1. Helpers允许你向你的模板添加超出在Ember中开箱即用的额外的功能.辅助器是最有用的,用于将来自模型和组件的原始值转换成更适合于用户的格式. 2. 例如,假设我们有一个Invoi ...

  7. Yii2 yii\helpers\ArrayHelper

    yii\helpers\ArrayHelper 是一个数组辅助类,提供额外的数组功能函数 toArray($object, $properties = [], $recursive = true) C ...

  8. The Difference Between @Helpers and @Functions In WebMatrix

    from: http://www.mikesdotnetting.com/article/173/the-difference-between-helpers-and-functions-in-web ...

  9. js 函数的防抖(debounce)与节流(throttle) 带 插件完整解析版 [helpers.js]

    前言:         本人纯小白一个,有很多地方理解的没有各位大牛那么透彻,如有错误,请各位大牛指出斧正!小弟感激不尽.         函数防抖与节流是做什么的?下面进行通俗的讲解. 本文借鉴:h ...

随机推荐

  1. asp.net微信公众平台开发

    http://mp.weixin.qq.com/wiki/index.php?title=%E6%B6%88%E6%81%AF%E6%8E%A5%E5%8F%A3%E6%8C%87%E5%8D%97 ...

  2. 排序算法(C#)

    1.插入排序 1.1直接插入排序 算法介绍: 直接插入排序(straight insertion sort)的做法是:   每次从无序表中取出第一个元素,把它插入到有序表的合适位置,使有序表仍然有序. ...

  3. 使用struts的同步令牌避免form的重复提交

    struts1避免重复提交 一.使用方法 1.  假如你要提交的页面为toSubmit.jsp: 2.  在打开toSubmit.jsp的Action1中加入:saveToken(request),例 ...

  4. leetcode@ [124] Binary Tree Maximum Path Sum (DFS)

    https://leetcode.com/problems/binary-tree-maximum-path-sum/ Given a binary tree, find the maximum pa ...

  5. <转>HTML中的table转为excel

    转换html 中的table 为excel,firefox浏览器支持,代码如下 <%@ page language="java" contentType="text ...

  6. Countly在andoid和vps集成使用,开源的统计分析sdk

    这几天项目需要,简单研究了一下countly,说实话完全满足项目需要,比umeng这类产品干净多了. Countly Mobile Analytics 下面就讲一下android 集成的过程,以及 服 ...

  7. Android studio优点及快捷键

    alt+回车 提示错误信息 ctrl+shift+回车 补全代码 ctrl+alt+o 导入包 ctrl+p 查看方法的参数 ctrl+alt+t 可以弹出包围结构的代码提示 例如if android ...

  8. MSSQLSERVER数据库- SP_EXECUTESQL的使用

    EXEC和SP_EXECUTESQL有什么区别呢? 1,它们之间最大的区别是嵌入式的参数,如下面一个语句 declare @sql nvarchar() declare @id varchar() ' ...

  9. HTTP 与 HTTPS 的区别

    本文转自:http://www.cnblogs.com/ok-lanyan/archive/2012/07/14/2591204.html HTTP是一个属于应用层的面向对象的协议,由于其简捷.快速的 ...

  10. redis优化优秀文选

    Redis是一个单线程的内存数据库.下载地址如下:http://download.redis.io/releases/redis-2.8.11.tar.gz在Redis的src目录运行make命令,然 ...