Ouzo\Utilities\Date::modifyNow PHP 메소드

modifyNow() 공개 정적인 메소드

Modifies the current time and returns a formatted date.
public static modifyNow ( string $interval, string $format = self::DEFAULT_TIME_FORMAT ) : string
$interval string
$format string
리턴 string
    public static function modifyNow($interval, $format = self::DEFAULT_TIME_FORMAT)
    {
        return Clock::now()->toDateTime()->modify($interval)->format($format);
    }

Usage Example

예제 #1
0
파일: DateTest.php 프로젝트: letsdrink/ouzo
 /**
  * @test
  */
 public function shouldModifyCurrentDate()
 {
     //when
     $date = Date::modifyNow('2 days');
     //then
     $this->assertGreaterThan(Clock::nowAsString(), $date);
 }