DateInterval
class DateInterval (View source)
Representation of date interval. A date interval stores either a fixed amount of time (in years, months, days, hours etc) or a relative time string in the format that DateTime's constructor supports.
Properties
int | $y | Number of years |
|
int | $m | Number of months |
|
int | $d | Number of days |
|
int | $h | Number of hours |
|
int | $i | Number of minutes |
|
int | $s | Number of seconds |
|
float
Since: 7.1.0
|
$f | Number of microseconds |
|
int | $invert | Is 1 if the interval is inverted and 0 otherwise |
|
int|false | $days | Total number of days the interval spans. If this is unknown, days will be FALSE. |
Methods
No description
Formats the interval
Sets up a DateInterval from the relative parts of the string
No description
No description
No description
No description
Details
__construct(string $duration)
No description
string
format(string $format)
Formats the interval
static DateInterval|false
createFromDateString(string $datetime)
Sets up a DateInterval from the relative parts of the string
void
__wakeup()
No description
static
__set_state($an_array)
No description
array
__serialize()
No description
void
__unserialize(array $data)
No description