Cake\Chronos\Traits\FactoryTrait::parse PHP Method

parse() public static method

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);
    }