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 ...
随机推荐
- 11、四大组件之二-Service高级(二)Native Service
一.Service的分类 1.1>Android Service 使用Java编写在JVM中运行的服务 1.2>Native Service 使用C/C++完成的服务,一般在系统开始时完成 ...
- HDU 1561-The more, The Better(树状背包)
题意: n个城堡,每个有一定的财富,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡,求应攻克哪m个城堡,获得最大财富. 分析:dp[i][j],以i为根的子树,攻克j个城堡,获得的 ...
- C#编写 "Hello,Word!" 您的第一个程序。
教程 下面的示例展示编写C#“Hello World”程序的几种不同的方法. 示例 1 //Hello1.cs public class Hello1 { public static void Mai ...
- 房租管理小软件(七):flowlayoutPancel 中增加分类控
见下图的 string FNodeName = dt.Rows[i]["FNodeName"].ToString(); ) { RoomControl.Thumbnail.Grou ...
- [LeetCode] Two Sum水过
刷LeetCode的第一题,TwoSum,基本算是水过. 题目:https://leetcode.com/problems/two-sum/ Given an array of integers, f ...
- js基础第四天
多个tab栏切换class封装 <style> *{margin:0;padding:0;} ul{list-style:none;} .b ...
- LeetCode题解——ZigZag Conversion
题目: 把一个字符串按照Z型排列后打印出来,例如 "PAYPALISHIRING" 重新排列后为3行,即 P A H N A P L S I I G Y I R 那么输出为&quo ...
- 基于野火M3开发板(STM32F103VET6)的迷宫小球(重力感应控制)游戏开发
2013-03-03 这是研一上学期<实时嵌入式系统实验>课程的大作业,是利用野火板的资源,加上一个AHRS(Attitude and Heading Reference System,姿 ...
- 云计算分布式大数据Hadoop实战高手之路第八讲Hadoop图文训练课程:Hadoop文件系统的操作实战
本讲通过实验的方式讲解Hadoop文件系统的操作. “云计算分布式大数据Hadoop实战高手之路”之完整发布目录 云计算分布式大数据实战技术Hadoop交流群:312494188,每天都会在群中发布云 ...
- HW6.30
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...