class FactoryImmutable extendsFactory

A factory to generate CarbonImmutable instances with common settings.

Properties

protected $className
protected $settings from Factory

Methods

__construct(array$settings =[],string|null$className =null)

No description

from Factory
getClassName()

No description

from Factory
setClassName(string$className)

No description

from Factory
className(string$className =null)

No description

from Factory
getSettings()

No description

from Factory
setSettings(array$settings)

No description

from Factory
settings(array$settings =null)

No description

from Factory
mergeSettings(array$settings)

No description

from Factory
__call($name,$arguments)

No description

from Factory
bool
canBeCreatedFromFormat($date,$format)

Checks if the (date)time string is in a given format and valid to create a

CarbonImmutable|false
create($year,$month =1,$day =1,$hour,$minute,$second,$tz =null)

Create a new Carbon instance from a specific date and time.

CarbonImmutable
createFromDate($year =null,$month =null,$day =null,$tz =null)

Create a Carbon instance from just a date. The time portion is set to now.

CarbonImmutable|false
createFromFormat($format,$time,$tz =null)

Create a Carbon instance from a specific format.

CarbonImmutable|false
createFromIsoFormat($format,$time,$tz =null,$locale ='en',$translator =null)

Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()).

CarbonImmutable|false
createFromLocaleFormat($format,$locale,$time,$tz =null)

Create a Carbon instance from a specific format and a string in a given language.

CarbonImmutable|false
createFromLocaleIsoFormat($format,$locale,$time,$tz =null)

Create a Carbon instance from a specific ISO format and a string in a given language.

CarbonImmutable
createFromTime($hour,$minute,$second,$tz =null)

Create a Carbon instance from just a time. The date portion is set to today.

CarbonImmutable
createFromTimeString($time,$tz =null)

Create a Carbon instance from a time string. The date portion is set to today.

CarbonImmutable
createFromTimestamp($timestamp,$tz =null)

Create a Carbon instance from a timestamp and set the timezone (use default one if not specified).

CarbonImmutable
createFromTimestampMs($timestamp,$tz =null)

Create a Carbon instance from a timestamp in milliseconds.

CarbonImmutable
createFromTimestampMsUTC($timestamp)

Create a Carbon instance from a timestamp in milliseconds.

CarbonImmutable
createFromTimestampUTC($timestamp)

Create a Carbon instance from an timestamp keeping the timezone to UTC.

CarbonImmutable
createMidnightDate($year =null,$month =null,$day =null,$tz =null)

Create a Carbon instance from just a date. The time portion is set to midnight.

CarbonImmutable|false
createSafe($year =null,$month =null,$day =null,$hour =null,$minute =null,$second =null,$tz =null)

Create a new safe Carbon instance from a specific date and time.

CarbonInterface
createStrict($tz =null)

Create a new Carbon instance from a specific date and time using strict validation.

CarbonImmutable
disableHumanDiffOption($humanDiffOption)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

CarbonImmutable
enableHumanDiffOption($humanDiffOption)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

mixed
executeWithLocale($locale,$func)

Set the current locale to the given, execute the passed function, reset the locale to previous one,

CarbonImmutable
fromSerialized($value)

Create an instance from a serialized string.

void
genericMacro($macro,$priority)

Register a custom macro.

array
getAvailableLocales()

Returns the list of internally available locales and already loaded custom locales.

array
getDays()

Get the days of the week

string|null
getFallbackLocale()

Get the fallback locale.

array
getFormatsToIsoReplacements()

List of replacements from date() format to isoFormat().

int
getHumanDiffOptions()

Return default humanDiff() options (merged flags as integer).

array
getIsoUnits()

Returns list of locale units for ISO formatting.

array
getLastErrors()

{@inheritdoc}

string
getLocale()

Get the current translator locale.

callable|null
getMacro($name)

Get the raw callable macro registered globally for a given name.

int
getMidDayAt()

get midday/noon hour

Closure|CarbonImmutable
getTestNow()

Get the Carbon instance (real or mock) to be returned when a "now"

string
getTimeFormatByPrecision($unitPrecision)

Return a format from H:i to H:i:s.u according to given unit precision.

string
getTranslationMessageWith($translator,string $key)

Returns raw translation message for a given key.

TranslatorInterface
getTranslator()

Get the default translator instance in use.

int
getWeekEndsAt()

Get the last day of week

int
getWeekStartsAt()

Get the first day of week

array
getWeekendDays()

Get weekend days

bool
hasFormat($date,$format)

Checks if the (date)time string is in a given format.

bool
hasFormatWithModifiers($date,$format)

Checks if the (date)time string is in a given format.

bool
hasMacro($name)

Checks if macro is registered globally.

bool
hasRelativeKeywords($time)

Determine if a time string will produce a relative date.

bool
hasTestNow()

Determine if there is a valid test instance set. A valid test instance

CarbonImmutable
instance($date)

Create a Carbon instance from a DateTime one.

bool
isImmutable()

Returns true if the current class/instance is immutable.

bool
isModifiableUnit($unit)

Returns true if a property can be changed via setter.

bool
isMutable()

Returns true if the current class/instance is mutable.

bool
isStrictModeEnabled()

Returns true if the strict mode is globally in use, false else.

bool
localeHasDiffOneDayWords($locale)

Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow).

bool
localeHasDiffSyntax($locale)

Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after).

bool
localeHasDiffTwoDayWords($locale)

Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow).

bool
localeHasPeriodSyntax($locale)

Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X).

bool
localeHasShortUnits($locale)

Returns true if the given locale is internally supported and has short-units support.

void
macro($name,$macro)

Register a custom macro.

CarbonImmutable|null
make($var)

Make a Carbon instance from given variable if possible.

CarbonImmutable
maxValue()

Create a Carbon instance for the greatest supported date.

CarbonImmutable
minValue()

Create a Carbon instance for the lowest supported date.

void
mixin($mixin)

Mix another object into the class.

CarbonImmutable
now($tz =null)

Get a Carbon instance for the current date and time.

CarbonImmutable
parse($time =null,$tz =null)

Create a carbon instance from a string.

CarbonImmutable
parseFromLocale($time,$locale =null,$tz =null)

Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.).

string
pluralUnit(string $unit)

Returns standardized plural of a given singular/plural unit name (in English).

CarbonImmutable|false
rawCreateFromFormat($format,$time,$tz =null)

Create a Carbon instance from a specific format.

CarbonImmutable
rawParse($time =null,$tz =null)

Create a carbon instance from a string.

CarbonImmutable
resetMacros()

Remove all macros and generic macros.

void
resetMonthsOverflow()

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

void
resetToStringFormat()

Reset the format used to the default when type juggling a Carbon instance to a string

void
resetYearsOverflow()

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

void
serializeUsing($callback)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

CarbonImmutable
setFallbackLocale($locale)

Set the fallback locale.

CarbonImmutable
setHumanDiffOptions($humanDiffOptions)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

bool
setLocale($locale)

Set the current translator locale and indicate if the source locale file exists.

void
setMidDayAt($hour)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

CarbonImmutable
setTestNow($testNow =null)

Set a Carbon instance (real or mock) to be returned when a "now"

CarbonImmutable
setTestNowAndTimezone($testNow =null,$tz =null)

Set a Carbon instance (real or mock) to be returned when a "now"

void
setToStringFormat($format)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

void
setTranslator(TranslatorInterface $translator)

Set the default translator instance to use.

CarbonImmutable
setUtf8($utf8)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

void
setWeekEndsAt($day)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

void
setWeekStartsAt($day)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

void
setWeekendDays($days)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

bool
shouldOverflowMonths()

Get the month overflow global behavior (can be overridden in specific instances).

bool
shouldOverflowYears()

Get the month overflow global behavior (can be overridden in specific instances).

string
singularUnit(string $unit)

Returns standardized singular of a given singular/plural unit name (in English).

CarbonImmutable
today($tz =null)

Create a Carbon instance for today.

CarbonImmutable
tomorrow($tz =null)

Create a Carbon instance for tomorrow.

string
translateTimeString($timeString,$from =null,$to =null,$mode =CarbonInterface::TRANSLATE_ALL)

Translate a time string from a locale to an other.

string
translateWith(TranslatorInterface $translator,string $key,array $parameters =[],$number =null)

Translate using translation string or callback available.

void
useMonthsOverflow($monthsOverflow =true)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

CarbonImmutable
useStrictMode($strictModeEnabled =true)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

void
useYearsOverflow($yearsOverflow =true)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

mixed
withTestNow($testNow =null,$callback =null)

Temporarily sets a static date to be used within the callback.

CarbonImmutable
yesterday($tz =null)

Create a Carbon instance for yesterday.

Details

inFactoryat line248
__construct(array$settings =[],string|null$className =null)

Parameters

array $settings
string|null $className

inFactoryat line257
getClassName()

inFactoryat line262
setClassName(string$className)

Parameters

string $className

inFactoryat line269
className(string$className =null)

Parameters

string $className

inFactoryat line274
getSettings()

inFactoryat line279
setSettings(array$settings)

Parameters

array $settings

inFactoryat line286
settings(array$settings =null)

Parameters

array $settings

inFactoryat line291
mergeSettings(array$settings)

Parameters

array $settings

inFactoryat line298
__call($name,$arguments)

Parameters

$name
$arguments

at line240
bool canBeCreatedFromFormat($date,$format)

Checks if the (date)time string is in a given format and valid to create a

Parameters

$date
$format

Return Value

bool

at line240
CarbonImmutable|false create($year,$month =1,$day =1,$hour,$minute,$second,$tz =null)

Create a new Carbon instance from a specific date and time.

Parameters

$year
$month
$day
$hour
$minute
$second
$tz

Return Value

CarbonImmutable|false

at line240
CarbonImmutable createFromDate($year =null,$month =null,$day =null,$tz =null)

Create a Carbon instance from just a date. The time portion is set to now.

Parameters

$year
$month
$day
$tz

Return Value

CarbonImmutable

at line240
CarbonImmutable|false createFromFormat($format,$time,$tz =null)

Create a Carbon instance from a specific format.

Parameters

$format
$time
$tz

Return Value

CarbonImmutable|false

at line240
CarbonImmutable|false createFromIsoFormat($format,$time,$tz =null,$locale ='en',$translator =null)

Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()).

Parameters

$format
$time
$tz
$locale
$translator

Return Value

CarbonImmutable|false

at line240
CarbonImmutable|false createFromLocaleFormat($format,$locale,$time,$tz =null)

Create a Carbon instance from a specific format and a string in a given language.

Parameters

$format
$locale
$time
$tz

Return Value

CarbonImmutable|false

at line240
CarbonImmutable|false createFromLocaleIsoFormat($format,$locale,$time,$tz =null)

Create a Carbon instance from a specific ISO format and a string in a given language.

Parameters

$format
$locale
$time
$tz

Return Value

CarbonImmutable|false

at line240
CarbonImmutable createFromTime($hour,$minute,$second,$tz =null)

Create a Carbon instance from just a time. The date portion is set to today.

Parameters

$hour
$minute
$second
$tz

Return Value

CarbonImmutable

at line240
CarbonImmutable createFromTimeString($time,$tz =null)

Create a Carbon instance from a time string. The date portion is set to today.

Parameters

$time
$tz

Return Value

CarbonImmutable

at line240
CarbonImmutable createFromTimestamp($timestamp,$tz =null)

Create a Carbon instance from a timestamp and set the timezone (use default one if not specified).

Parameters

$timestamp
$tz

Return Value

CarbonImmutable

at line240
CarbonImmutable createFromTimestampMs($timestamp,$tz =null)

Create a Carbon instance from a timestamp in milliseconds.

Parameters

$timestamp
$tz

Return Value

CarbonImmutable

at line240
CarbonImmutable createFromTimestampMsUTC($timestamp)

Create a Carbon instance from a timestamp in milliseconds.

Parameters

$timestamp

Return Value

CarbonImmutable

at line240
CarbonImmutable createFromTimestampUTC($timestamp)

Create a Carbon instance from an timestamp keeping the timezone to UTC.

Parameters

$timestamp

Return Value

CarbonImmutable

at line240
CarbonImmutable createMidnightDate($year =null,$month =null,$day =null,$tz =null)

Create a Carbon instance from just a date. The time portion is set to midnight.

Parameters

$year
$month
$day
$tz

Return Value

CarbonImmutable

at line240
CarbonImmutable|false createSafe($year =null,$month =null,$day =null,$hour =null,$minute =null,$second =null,$tz =null)

Create a new safe Carbon instance from a specific date and time.

Parameters

$year
$month
$day
$hour
$minute
$second
$tz

Return Value

CarbonImmutable|false

at line240
CarbonInterface createStrict($tz =null)

Create a new Carbon instance from a specific date and time using strict validation.

Parameters

$tz

Return Value

CarbonInterface

at line240
CarbonImmutable disableHumanDiffOption($humanDiffOption)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Parameters

$humanDiffOption

Return Value

CarbonImmutable

at line240
CarbonImmutable enableHumanDiffOption($humanDiffOption)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Parameters

$humanDiffOption

Return Value

CarbonImmutable

at line240
mixed executeWithLocale($locale,$func)

Set the current locale to the given, execute the passed function, reset the locale to previous one,

Parameters

$locale
$func

Return Value

mixed

at line240
CarbonImmutable fromSerialized($value)

Create an instance from a serialized string.

Parameters

$value

Return Value

CarbonImmutable

at line240
void genericMacro($macro,$priority)

Register a custom macro.

Parameters

$macro
$priority

Return Value

void

at line240
array getAvailableLocales()

Returns the list of internally available locales and already loaded custom locales.

Return Value

array

at line240
array getDays()

Get the days of the week

Return Value

array

at line240
string|null getFallbackLocale()

Get the fallback locale.

Return Value

string|null

at line240
array getFormatsToIsoReplacements()

List of replacements from date() format to isoFormat().

Return Value

array

at line240
int getHumanDiffOptions()

Return default humanDiff() options (merged flags as integer).

Return Value

int

at line240
array getIsoUnits()

Returns list of locale units for ISO formatting.

Return Value

array

at line240
array getLastErrors()

{@inheritdoc}

Return Value

array

at line240
string getLocale()

Get the current translator locale.

Return Value

string

at line240
callable|null getMacro($name)

Get the raw callable macro registered globally for a given name.

Parameters

$name

Return Value

callable|null

at line240
int getMidDayAt()

get midday/noon hour

Return Value

int

at line240
Closure|CarbonImmutable getTestNow()

Get the Carbon instance (real or mock) to be returned when a "now"

Return Value

Closure|CarbonImmutable

at line240
string getTimeFormatByPrecision($unitPrecision)

Return a format from H:i to H:i:s.u according to given unit precision.

Parameters

$unitPrecision

Return Value

string

at line240
string getTranslationMessageWith($translator,string $key)

Returns raw translation message for a given key.

Parameters

$translator
string $key

Return Value

string

at line240
TranslatorInterface getTranslator()

Get the default translator instance in use.

Return Value

TranslatorInterface

at line240
int getWeekEndsAt()

Get the last day of week

Return Value

int

at line240
int getWeekStartsAt()

Get the first day of week

Return Value

int

at line240
array getWeekendDays()

Get weekend days

Return Value

array

at line240
bool hasFormat($date,$format)

Checks if the (date)time string is in a given format.

Parameters

$date
$format

Return Value

bool

at line240
bool hasFormatWithModifiers($date,$format)

Checks if the (date)time string is in a given format.

Parameters

$date
$format

Return Value

bool

at line240
bool hasMacro($name)

Checks if macro is registered globally.

Parameters

$name

Return Value

bool

at line240
bool hasRelativeKeywords($time)

Determine if a time string will produce a relative date.

Parameters

$time

Return Value

bool

at line240
bool hasTestNow()

Determine if there is a valid test instance set. A valid test instance

Return Value

bool

at line240
CarbonImmutable instance($date)

Create a Carbon instance from a DateTime one.

Parameters

$date

Return Value

CarbonImmutable

at line240
bool isImmutable()

Returns true if the current class/instance is immutable.

Return Value

bool

at line240
bool isModifiableUnit($unit)

Returns true if a property can be changed via setter.

Parameters

$unit

Return Value

bool

at line240
bool isMutable()

Returns true if the current class/instance is mutable.

Return Value

bool

at line240
bool isStrictModeEnabled()

Returns true if the strict mode is globally in use, false else.

Return Value

bool

at line240
bool localeHasDiffOneDayWords($locale)

Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow).

Parameters

$locale

Return Value

bool

at line240
bool localeHasDiffSyntax($locale)

Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after).

Parameters

$locale

Return Value

bool

at line240
bool localeHasDiffTwoDayWords($locale)

Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow).

Parameters

$locale

Return Value

bool

at line240
bool localeHasPeriodSyntax($locale)

Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X).

Parameters

$locale

Return Value

bool

at line240
bool localeHasShortUnits($locale)

Returns true if the given locale is internally supported and has short-units support.

Parameters

$locale

Return Value

bool

at line240
void macro($name,$macro)

Register a custom macro.

Parameters

$name
$macro

Return Value

void

at line240
CarbonImmutable|null make($var)

Make a Carbon instance from given variable if possible.

Parameters

$var

Return Value

CarbonImmutable|null

at line240
CarbonImmutable maxValue()

Create a Carbon instance for the greatest supported date.

Return Value

CarbonImmutable

at line240
CarbonImmutable minValue()

Create a Carbon instance for the lowest supported date.

Return Value

CarbonImmutable

at line240
void mixin($mixin)

Mix another object into the class.

Parameters

$mixin

Return Value

void

at line240
CarbonImmutable now($tz =null)

Get a Carbon instance for the current date and time.

Parameters

$tz

Return Value

CarbonImmutable

at line240
CarbonImmutable parse($time =null,$tz =null)

Create a carbon instance from a string.

Parameters

$time
$tz

Return Value

CarbonImmutable

at line240
CarbonImmutable parseFromLocale($time,$locale =null,$tz =null)

Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.).

Parameters

$time
$locale
$tz

Return Value

CarbonImmutable

at line240
string pluralUnit(string $unit)

Returns standardized plural of a given singular/plural unit name (in English).

Parameters

string $unit

Return Value

string

at line240
CarbonImmutable|false rawCreateFromFormat($format,$time,$tz =null)

Create a Carbon instance from a specific format.

Parameters

$format
$time
$tz

Return Value

CarbonImmutable|false

at line240
CarbonImmutable rawParse($time =null,$tz =null)

Create a carbon instance from a string.

Parameters

$time
$tz

Return Value

CarbonImmutable

at line240
CarbonImmutable resetMacros()

Remove all macros and generic macros.

Return Value

CarbonImmutable

at line240
void resetMonthsOverflow()

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Return Value

void

at line240
void resetToStringFormat()

Reset the format used to the default when type juggling a Carbon instance to a string

Return Value

void

at line240
void resetYearsOverflow()

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Return Value

void

at line240
void serializeUsing($callback)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Parameters

$callback

Return Value

void

at line240
CarbonImmutable setFallbackLocale($locale)

Set the fallback locale.

Parameters

$locale

Return Value

CarbonImmutable

at line240
CarbonImmutable setHumanDiffOptions($humanDiffOptions)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Parameters

$humanDiffOptions

Return Value

CarbonImmutable

at line240
bool setLocale($locale)

Set the current translator locale and indicate if the source locale file exists.

Parameters

$locale

Return Value

bool

at line240
void setMidDayAt($hour)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Parameters

$hour

Return Value

void

at line240
CarbonImmutable setTestNow($testNow =null)

Set a Carbon instance (real or mock) to be returned when a "now"

Parameters

$testNow

Return Value

CarbonImmutable

at line240
CarbonImmutable setTestNowAndTimezone($testNow =null,$tz =null)

Set a Carbon instance (real or mock) to be returned when a "now"

Parameters

$testNow
$tz

Return Value

CarbonImmutable

at line240
void setToStringFormat($format)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Parameters

$format

Return Value

void

at line240
void setTranslator(TranslatorInterface $translator)

Set the default translator instance to use.

Parameters

TranslatorInterface $translator

Return Value

void

at line240
CarbonImmutable setUtf8($utf8)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Parameters

$utf8

Return Value

CarbonImmutable

at line240
void setWeekEndsAt($day)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Parameters

$day

Return Value

void

at line240
void setWeekStartsAt($day)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Parameters

$day

Return Value

void

at line240
void setWeekendDays($days)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Parameters

$days

Return Value

void

at line240
bool shouldOverflowMonths()

Get the month overflow global behavior (can be overridden in specific instances).

Return Value

bool

at line240
bool shouldOverflowYears()

Get the month overflow global behavior (can be overridden in specific instances).

Return Value

bool

at line240
string singularUnit(string $unit)

Returns standardized singular of a given singular/plural unit name (in English).

Parameters

string $unit

Return Value

string

at line240
CarbonImmutable today($tz =null)

Create a Carbon instance for today.

Parameters

$tz

Return Value

CarbonImmutable

at line240
CarbonImmutable tomorrow($tz =null)

Create a Carbon instance for tomorrow.

Parameters

$tz

Return Value

CarbonImmutable

at line240
string translateTimeString($timeString,$from =null,$to =null,$mode =CarbonInterface::TRANSLATE_ALL)

Translate a time string from a locale to an other.

Parameters

$timeString
$from
$to
$mode

Return Value

string

at line240
string translateWith(TranslatorInterface $translator,string $key,array $parameters =[],$number =null)

Translate using translation string or callback available.

Parameters

TranslatorInterface $translator
string $key
array $parameters
$number

Return Value

string

at line240
void useMonthsOverflow($monthsOverflow =true)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Parameters

$monthsOverflow

Return Value

void

at line240
CarbonImmutable useStrictMode($strictModeEnabled =true)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Parameters

$strictModeEnabled

Return Value

CarbonImmutable

at line240
void useYearsOverflow($yearsOverflow =true)

@deprecated To avoid conflict between different third-party libraries, static setters should not be used.

Parameters

$yearsOverflow

Return Value

void

at line240
mixed withTestNow($testNow =null,$callback =null)

Temporarily sets a static date to be used within the callback.

Parameters

$testNow
$callback

Return Value

mixed

at line240
CarbonImmutable yesterday($tz =null)

Create a Carbon instance for yesterday.

Parameters

$tz

Return Value

CarbonImmutable