DateTime
extends DateTime
in package
implements
Stringable, IMarshallable
FinalYes
Tags
Table of Contents
Interfaces
- Stringable
- IMarshallable
Constants
- DEFAULT_FORMAT = 'Y-m-d H:i'
Methods
- __construct() : mixed
- __toString() : string
- add() : DateTime
- {@inheritdoc}
- beforeMidnightTomorrow() : mixed
- endOfMonth() : mixed
- endOfWeek() : mixed
- getCurrentTimestamp() : mixed
- getDate() : string
- getDateTime() : string
- getDayName() : string
- Gets the full name of the day for this Wolfgang\Date\DateTime instance
- getElapsedTime() : string
- getModelTimezone() : Timezone
- getTime() : string
- getUTCAndLocalDatetimes() : mixed
- marshall() : mixed
- setTimezone() : DateTime
- startOfMonth() : mixed
- startOfWeek() : mixed
- strDateTime() : DateTime
- Gets an instance of the class Wolfgang\Date\DateTime by a provided str time.
- todayMidnight() : mixed
- tomorrow() : mixed
Constants
DEFAULT_FORMAT
public
mixed
DEFAULT_FORMAT
= 'Y-m-d H:i'
Methods
__construct()
public
__construct([string $time = "now" ][, DateTimeZone $timezone = null ]) : mixed
Parameters
- $time : string = "now"
- $timezone : DateTimeZone = null
__toString()
public
__toString() : string
Return values
stringadd()
{@inheritdoc}
public
add(DateInterval|string $interval) : DateTime
Parameters
- $interval : DateInterval|string
Tags
Return values
DateTimebeforeMidnightTomorrow()
public
static beforeMidnightTomorrow([ITimezone $timezone = NULL ]) : mixed
Parameters
- $timezone : ITimezone = NULL
endOfMonth()
public
static endOfMonth([ITimezone $timezone = NULL ]) : mixed
Parameters
- $timezone : ITimezone = NULL
endOfWeek()
public
static endOfWeek([ITimezone $timezone = NULL ]) : mixed
Parameters
- $timezone : ITimezone = NULL
getCurrentTimestamp()
public
static getCurrentTimestamp() : mixed
getDate()
public
getDate([mixed $format = 'Y-m-d' ]) : string
Parameters
- $format : mixed = 'Y-m-d'
Return values
stringgetDateTime()
public
getDateTime([mixed $format = 'Y-m-d H:i:s' ]) : string
Parameters
- $format : mixed = 'Y-m-d H:i:s'
Return values
stringgetDayName()
Gets the full name of the day for this Wolfgang\Date\DateTime instance
public
getDayName() : string
Return values
stringgetElapsedTime()
public
getElapsedTime([DateTime $datetime = null ]) : string
Parameters
- $datetime : DateTime = null
Return values
stringgetModelTimezone()
public
getModelTimezone() : Timezone
Return values
TimezonegetTime()
public
getTime([mixed $format = 'H:i:s' ]) : string
Parameters
- $format : mixed = 'H:i:s'
Return values
stringgetUTCAndLocalDatetimes()
public
static getUTCAndLocalDatetimes(string $datetime, DateTime &$utc_datetime, DateTime &$local_datetime, string $timezone_label[, bool $is_utc = FALSE ]) : mixed
Parameters
marshall()
public
marshall() : mixed
Tags
setTimezone()
public
setTimezone(DateTimeZone|ITimezone $timezone) : DateTime
Parameters
- $timezone : DateTimeZone|ITimezone
Return values
DateTimestartOfMonth()
public
static startOfMonth([ITimezone $timezone = NULL ]) : mixed
Parameters
- $timezone : ITimezone = NULL
startOfWeek()
public
static startOfWeek([ITimezone $timezone = NULL ]) : mixed
Parameters
- $timezone : ITimezone = NULL
strDateTime()
Gets an instance of the class Wolfgang\Date\DateTime by a provided str time.
public
static strDateTime(string $str_datetime[, string $timezone = NULL ]) : DateTime
Parameters
- $str_datetime : string
- $timezone : string = NULL
Return values
DateTimetodayMidnight()
public
static todayMidnight([ITimezone $timezone = NULL ]) : mixed
Parameters
- $timezone : ITimezone = NULL
tomorrow()
public
tomorrow() : mixed