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 ...
随机推荐
- 多线程程序设计学习(6)Producer-Consumer模式
Producer-Consumer[生产消费者模式]一:Producer-Consumer pattern的参与者--->产品(蛋糕)--->通道(传递蛋糕的桌子)--->生产者线程 ...
- UVA 1474 Evacuation Plan
题意:有一条公路,上面有n个施工队,要躲进m个避难所中,每个避难所中至少有一个施工队,躲进避难所的花费为施工队与避难所的坐标差的绝对值,求最小花费及策略. 解法:将施工队和避难所按坐标排序,可以看出有 ...
- 《深入Java虚拟机学习笔记》- 第11章 类型转换
Java虚拟机包括许多进行基本类型转换工作的操作码,这些执行转换工作的操作码后面没有操作数,转换的值从栈顶断获得.Java虚拟机从栈顶端弹出一个值,对它进行转换,然后再把转换结果压入栈. int.lo ...
- CXF之三 Tomcat中发布Web Service
服务接口及实现类请参考CXF之一 创建Maven Web项目,在pom.xml中添加CXF和spring Web的引用,由于CXFServlet需要Spring Web的支持. <project ...
- linux 打开远程samba服务器
sudo mount -t cifs //10.104.*.*data /home/leeyoung/samba/ -o username=123,password=123
- Base-Android快速开发框架(一)--概述
首先简单介绍一下Base.Base是本人长期以来经过10来款APP总结出来的一个Android快速开发框架.包含数据缓存模块.工具包.第三方组件包.网络模块.数据解析.常用主界面布局等.可以快速的开发 ...
- visual studio 中使用git
原文链接:http://my.oschina.net/gal/blog/141442 osc终于全面开放git库了,这是我一直期待的事,也是促使我从CSDN转回OSC社区的重要原因之一.而这次我来教大 ...
- python网络编程(六)---web客户端访问
1.获取web页面 urllib2 支持任何协议的工作---不仅仅是http,还包括FTP,Gopher. import urllib2 req=urllib2.Request('http://www ...
- 609B Load Balancing
题意:有n本书分m个类别,现在你要买两本不属于同一类别的书,问有多少种方案. #include<iostream> #include<cstdlib> #include< ...
- leetcode@ [136/137] Single Number & Single Number II
https://leetcode.com/problems/single-number/ Given an array of integers, every element appears twice ...