Skip to content
/ Chronos Public

Chronos is a PHP library/package for date and time management.

License

Notifications You must be signed in to change notification settings

Zazalt/Chronos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chronos

Build Status Coverage Status Code Climate Issue Count Total Downloads Latest Stable Version Version

Chronos is a PHP library/package for date and time management.

Requirements

  • php >= 7.1.0

Packagist Dependencies

  • None

Installation

With composer:

{
	"require": {
		"zazalt/chronos": "dev-master"
	}
}

Usage

$Chronos = new Zazalt\Chronos\Chronos();

/**
 * Transform/parse a human date to machine date (Y-m-d)
 * 	eg: 28.09.2013 (d.m.Y) => 2013-09-28
 *
 * @return  string
 */
$Chronos->dateToMachineDate($datetime, $humanFormat);

/**
 * Transform/parse a human date to machine date (Y-m-d H:i:s)
 * 	eg: 28.09.2013 23:41:12 => 2013-09-28 23:41:12
 *
 * @return  string
 */
$Chronos->dateToMachineDateTime($datetime, $humanFormat);

/**
 * Transform/parse a machine date to human date
 * 	eg: 01.09.2013 => 2013-09-01
 *
 */
$Chronos->dateToHuman($datetime, $humanFormat);

/**
 * Return days number between two dates
 *
 * @return  integer
 *
 */
$Chronos->daysBetweenTwoDates($startDate, $endDate);

/**
 * Return months number between two dates
 *
 * @return  integer
 */
$Chronos->monthsBetweenTwoDates($startDate, $endDate);

/**
 * Return years number between two dates
 *
 * @return  integer
 */
$Chronos->yearsBetweenTwoDates($startDate, $endDate);

/**
 * Not implemented/documented, yet!
 */
$Chronos->seconds2HMS($secs);

About

Chronos is a PHP library/package for date and time management.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages