Toggle navigation
Hot Examples
FR
EN
RU
DE
FR
ES
PT
IT
JP
ZH
KO
PHP
PHP
C#
Java
Go
C++
Python
JS
TS
Rechercher
Accueil
Cake
Chronos
Traits
FactoryTrait
parse
Cake\Chronos\Traits\FactoryTrait::parse PHP Méthode
FactoryTrait Trait Documentation
Afficher le fichier
Open project: cakephp/chronos
parse()
public
static
méthode
Create a ChronosInterface instance from a string. This is an alias for the constructor that allows better fluent syntax as it allows you to do ChronosInterface::parse('Monday next week')->fn() rather than (new Chronos('Monday next week'))->fn()
public
static
parse
(
string
$time
= 'now',
DateTimeZon\DateTimeZone |
string
|
null
$tz
= null )
$time
string
The strtotime compatible string to parse
$tz
DateTimeZon\DateTimeZone |
string
|
null
The DateTimeZone object or timezone name.
public static function parse($time = 'now', $tz = null) { return new static($time, $tz); }
FactoryTrait
create
createFromDate
createFromFormat
createFromTime
createFromTimestamp
createFromTimestampUTC
getLastErrors
instance
maxValue
minValue
now
parse
safeCreateDateTimeZone
today
tomorrow
yesterday