21 lines
407 B
PHP
21 lines
407 B
PHP
<?php
|
|
namespace nulib\php\time;
|
|
|
|
use DateTimeZone;
|
|
|
|
/**
|
|
* Class Date: une date
|
|
*/
|
|
class Date extends DateTime {
|
|
const DEFAULT_FORMAT = "d/m/Y";
|
|
|
|
function __construct($datetime="now", DateTimeZone $timezone=null) {
|
|
parent::__construct($datetime, $timezone);
|
|
$this->setTime(0, 0, 0, 0);
|
|
}
|
|
|
|
function format($format=self::DEFAULT_FORMAT): string {
|
|
return \DateTime::format($format);
|
|
}
|
|
}
|