toStamp() публичный статический Метод

Convert to timestamp
public static toStamp ( string | DateTim\DateTime $time = null, boolean $currentIsDefault = true ) : integer
$time string | DateTim\DateTime
$currentIsDefault boolean
Результат integer
Пример #1
0
 public function testToStamp()
 {
     is('1446203259', Dates::toStamp(new \DateTime('2015-10-30 11:07:39')));
     is(0, Dates::toStamp('undefined date', false));
     isTrue(is_numeric(Dates::toStamp(null)));
     $time = time();
     is($time, Dates::toStamp());
     is($time, Dates::toStamp($time));
     isTrue(is_numeric(Dates::toStamp('+1 week')));
     isTrue(is_numeric(Dates::toStamp(new DateTime())));
 }