Method |
Description |
|
add ( DateTime $date, string | DateInterval $interval ) : DateTime |
Add an interval to a date and return a new DateTime object |
|
allowsCallOfMethod ( string $methodName ) : boolean |
All methods are considered safe |
|
dayOfMonth ( DateTimeInterface $dateTime ) : integer |
Get the day of month of a date |
|
diff ( DateTime $dateA, DateTime $dateB ) : DateInterval |
Get the difference between two dates as a \DateInterval object |
|
format ( integer | string | DateTime | DateInterval $date, string $format ) : string |
Format a date (or interval) to a string with a given format |
|
hour ( DateTimeInterface $dateTime ) : integer |
Get the hour of a date (24 hour format) |
|
minute ( DateTimeInterface $dateTime ) : integer |
Get the minute of a date |
|
month ( DateTimeInterface $dateTime ) : integer |
Get the month of a date |
|
now ( ) : DateTime |
Get the current date and time |
|
parse ( string $string, string $format ) : DateTime |
Parse a date from string with a format to a DateTime object |
|
second ( DateTimeInterface $dateTime ) : integer |
Get the second of a date |
|
subtract ( DateTime $date, string | DateInterval $interval ) : DateTime |
Subtract an interval from a date and return a new DateTime object |
|
today ( ) : DateTime |
Get the current date |
|
year ( DateTimeInterface $dateTime ) : integer |
Get the year of a date |
|