<?php
namespace nur\sery\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);
  }

  function format($format=self::DEFAULT_FORMAT): string {
    return \DateTime::format($format);
  }
}
