DateTimeInterface (interface)
The DateTimeInterface interface
Introduction
(PHP 5 >= 5.5.0, PHP 7)
DateTimeInterface is meant so that both DateTime and DateTimeImmutable can be type hinted for. It is not possible to implement this interface with userland classes.
Class synopsis
DateTimeInterface {
/* Methods */
public DateInterval diff ( DateTimeInterface $datetime2 [, bool $absolute = false ] )
public string format ( string $format )
public int getOffset ( void )
登录查看完整内容