Tribe__Date_Utils::mutable( string|DateTime|int $datetime = 'now', string|DateTimeZone|null $timezone = null, bool $with_fallback = true )
Builds a date object from a given datetime and timezone.
Contents
An alias of the Tribe__Date_Utils::build_date_object function.
Parameters
- $datetime
-
(string|DateTime|int) (Optional) A
strtotimeparse-able string, a DateTime object or a timestamp; defaults tonow.Default value: 'now'
- $timezone
-
(string|DateTimeZone|null) (Optional) A timezone string, UTC offset or DateTimeZone object; defaults to the site timezone; this parameter is ignored if the
$datetimeparameter is a DatTime object.Default value: null
- $with_fallback
-
(bool) (Optional) Whether to return a DateTime object even when the date data is invalid or not; defaults to
true.Default value: true
Return
(DateTime|false) A DateTime object built using the specified date, time and timezone; if $with_fallback is set to false then false will be returned if a DateTime object could not be built.
Source
File: src/Tribe/Date_Utils.php
public static function mutable( $datetime = 'now', $timezone = null, $with_fallback = true ) {
return static::build_date_object( $datetime, $timezone, $with_fallback );
}
Changelog
| Version | Description |
|---|---|
| 4.10.2 | Introduced. |