ExpressiveDate::makeFromDate PHP Method

makeFromDate() public static method

Make and return a new ExpressiveDate instance with defined year, month, and day.
public static makeFromDate ( integer $year = null, integer $month = null, integer $day = null, string | DateTimeZone $timezone = null ) : ExpressiveDate
$year integer
$month integer
$day integer
$timezone string | DateTimeZone
return ExpressiveDate
    public static function makeFromDate($year = null, $month = null, $day = null, $timezone = null)
    {
        return static::makeFromDateTime($year, $month, $day, null, null, null, $timezone);
    }

Usage Example

Beispiel #1
0
 public function testDateIsCreatedFromDate()
 {
     $date = ExpressiveDate::makeFromDate(2013, 1, 31);
     $this->assertEquals('2013-01-31', $date->getDate());
 }