PHP Class PHPDaemon\Utils\DateTime

Inheritance: extends DateTime
Afficher le fichier Open project: kakserpom/phpdaemon Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $time = 'now', DateTimeZone $timezone = null ) Support timestamp and available date format
diffAsText ( integer | string | DateTimeInterface $datetime1, integer | string | DateTimeInterface $datetime2, boolean $absolute = false ) : string Calculates a difference between two dates

Method Details

__construct() public méthode

Support timestamp and available date format
public __construct ( string $time = 'now', DateTimeZone $timezone = null )
$time string
$timezone DateTimeZone

diffAsText() public static méthode

Calculates a difference between two dates
See also: http://www.php.net/manual/en/datetime.diff.php
public static diffAsText ( integer | string | DateTimeInterface $datetime1, integer | string | DateTimeInterface $datetime2, boolean $absolute = false ) : string
$datetime1 integer | string | DateTimeInterface
$datetime2 integer | string | DateTimeInterface
$absolute boolean
Résultat string Something like this: 1 year. 2 mon. 6 day. 4 hours. 21 min. 10 sec.