Method |
Description |
|
__call ( string $method, array $args ) : mixed |
Calls a method directly on the internal \DateTime object. |
|
__construct ( string | integer | Time | DateTime $time, string | DateTimeZone $timeZone = null ) |
Constructor. |
|
__get ( string $name ) : mixed |
Returns date/time in the requested format. |
|
__toString ( ) : string |
Returns date/time in the unix timestamp format. |
|
createFromFormat ( string $format, string $time ) : self |
Creates an instance using a date/time definition in the given format. |
|
format ( string $format, string | DateTimeZone $timeZone = null ) : string |
Returns date/time in the given format with months and days translated. |
|
formatAsInterval ( boolean $useTense = true, string | DateTimeZone $timeZone = null ) : string |
Function for formatting time differences into human readable forms. |
|
formatExtended ( string $dateFormat = 'j. F Y', string $timeFormat = 'G:i', string | DateTimeZone $timeZone = null ) : string |
Returns date/time in the form of: |
|
get ( string | integer | Time | DateTime $time, string | DateTimeZone $timeZone = null ) : self |
Helper function for creating an instance with the given date/time. |
|
getTimeZone ( ) : DateTimeZone |
Returns the actual time zone. |
|
hasHappened ( ) : boolean |
Checks if the date/time already happened. |
|
minus ( integer | string $interval ) : self |
Returns a new date/time object and adds with the given interval subtracted. |
|
now ( ) : self |
Returns an instance with the current date/time. |
|
plus ( integer | string $interval ) : self |
Returns a new date/time object and adds with the given interval added. |
|
serialize ( ) : string |
Object serialization. |
|
setTimeZone ( string | DateTimeZone $timeZone ) : self |
Sets a new time zone. |
|
truncate ( string $unit ) : self |
Returns a new instance with date/time truncated to the given unit. |
|
unserialize ( string $serialized ) |
Object deserialization. |
|