You are here

public static function Carbon::parse in Persian Date for Drupal 8 8.4

Create a carbon instance from a string.

This is an alias for the constructor that allows better fluent syntax as it allows you to do Carbon::parse('Monday next week')->fn() rather than (new Carbon('Monday next week'))->fn().

Parameters

string|null $time:

\DateTimeZone|string|null $tz:

Return value

static

1 call to Carbon::parse()
Carbon::setTestNow in src/Library/Carbon/Carbon.php
Set a Carbon instance (real or mock) to be returned when a "now" instance is created. The provided instance will be returned specifically under the following conditions:

File

src/Library/Carbon/Carbon.php, line 322

Class

Carbon
A simple API extension for DateTime

Namespace

Drupal\persian_date\Library\Carbon

Code

public static function parse($time = null, $tz = null) {
  return new static($time, $tz);
}