承接 pleonovich/dateedit 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pleonovich/dateedit

Composer 安装命令:

composer require pleonovich/dateedit

包简介

Simple way to edit date data.

关键字:

README 文档

README

Simple way to edit date data

Key features

  • date validation;
  • date format validation;
  • date format convertion;
  • easy date to unix convertion;
  • easy change year, month, week, day or hour.

Some examples

validate

// Description:
boolean validate ( string $date , string $format )

$valid = DateEdit::validate("2017.02.03","Y.m.d");
// result: $valid = true

$valid = DateEdit::validate("2017.13.03","Y.m.d");
// result: $valid = false

checkFormat

// Description:
boolean checkFormat ( string $date , string $format )

$check = DateEdit::checkFormat("2017.02.03","Y.m.d");
// result: $check = true

$check = DateEdit::checkFormat("03.02.2017","Y.m.d");
// result: $check = false

convertFormat

// Description:
string convertFormat ( string $date , string $informat , string $outformat )

echo DateEdit::convertFormat("2017.02.03","Y.m.d","d-m-Y");
// result: 03-02-2017

dateToUnix

// Description:
int dateToUnix ( string $date , string $format )

echo DateEdit::dateToUnix("2017.06.18","Y.m.d");
// result: 1497744000

unixToDate

// Description:
string unixToDate ( int $date , string $format )

echo  DateEdit::unixToDate(1497744000,"Y.m.d");
// result: 2017.06.18

changeDate

// Description:
string changeDate( string $date , string $format [, string $period = 'day' [, int $NUM = 1 [, string $direction = '+' ]]] )

echo  DateEdit::changeDate( "2017.02.03" , "Y.m.d" , 'day', 1, '+');
// result: 2017.02.04

changeYear

// Description:
string changeYear ( string $date , string $format [, int yearN = 1 [, string direction = '+' ]] )

echo  DateEdit::changeYear("2017.02.03", "Y.m.d", 1, '+');
// result: 2018.02.03

changeMonth

// Description:
string changeMonth ( string $date , string $format [, int monthN = 1 [, string direction = '+' ]] )

echo  DateEdit::changeMonth("2017.06.17", "Y.m.d", 1, '+');
// result: 2017.07.17

changeWeek

// Description:
string changeWeek ( string $date , string $format [, int weekN = 1 [, string direction = '+' ]] )

echo  DateEdit::changeWeek("2017.06.17", "Y.m.d", 1, '+');
// result: 2017.06.24

changeDay

// Description:
string changeDay ( string $date , string $format [, int dayN = 1 [, string direction = '+' ]] )

echo  DateEdit::changeDay("2017.06.17", "Y.m.d", 1, '+');
// result: 2017.06.18

changeHours

// Description:
string changeHours ( string $date , string $format [, int hoursN = 1 [, string direction = '+' ]] )

echo  DateEdit::changeHours("2017.06.17 23:39:00", "Y.m.d H:i:s", 1, '+');
// result: 2017.06.18 00:39:00

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2018-11-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固