class DateFactory (View source)

Constants

DEFAULT_CLASS_NAME

The default class that will be used for all created dates.

Properties

static protected string $dateClass

The type (class) of dates that should be created.

static protected callable $callable

This callable may be used to intercept date creation.

static protected object $factory

The Carbon factory that should be used when creating dates.

Methods

static mixed
use(mixed $handler)

Use the given handler when generating dates (class name, callable, or factory).

static void
useDefault()

Use the default date class when generating dates.

static void
useCallable(callable $callable)

Execute the given callable on each date creation.

static void
useClass(string $dateClass)

Use the given date type (class) when generating dates.

static void
useFactory(object $factory)

Use the given Carbon factory when generating dates.

mixed
__call(string $method, array $parameters)

Handle dynamic calls to generate dates.

create(mixed $year, mixed $month, mixed $day, mixed $hour, mixed $minute, mixed $second, mixed $tz)

No description

createFromDate(mixed $year, mixed $month, mixed $day, mixed $tz)

No description

Carbon|false
createFromFormat(mixed $format, mixed $time, mixed $tz)

No description

createFromTime(mixed $hour, mixed $minute, mixed $second, mixed $tz)

No description

createFromTimeString(mixed $time, mixed $tz)

No description

createFromTimestamp(mixed $timestamp, mixed $tz)

No description

createFromTimestampMs(mixed $timestamp, mixed $tz)

No description

createFromTimestampUTC(mixed $timestamp)

No description

createMidnightDate(mixed $year, mixed $month, mixed $day, mixed $tz)

No description

Carbon|false
createSafe(mixed $year, mixed $month, mixed $day, mixed $hour, mixed $minute, mixed $second, mixed $tz)

No description

void
disableHumanDiffOption(mixed $humanDiffOption)

No description

void
enableHumanDiffOption(mixed $humanDiffOption)

No description

mixed
executeWithLocale(mixed $locale, mixed $func)

No description

fromSerialized(mixed $value)

No description

array
getAvailableLocales()

No description

array
getDays()

No description

int
getHumanDiffOptions()

No description

array
getIsoUnits()

No description

array
getLastErrors()

No description

string
getLocale()

No description

int
getMidDayAt()

No description

Carbon|null
getTestNow()

No description

TranslatorInterface
getTranslator()

No description

int
getWeekEndsAt()

No description

int
getWeekStartsAt()

No description

array
getWeekendDays()

No description

bool
hasFormat(mixed $date, mixed $format)

No description

bool
hasMacro(mixed $name)

No description

bool
hasRelativeKeywords(mixed $time)

No description

bool
hasTestNow()

No description

instance(mixed $date)

No description

bool
isImmutable()

No description

bool
isModifiableUnit(mixed $unit)

No description

bool
isMutable()

No description

bool
isStrictModeEnabled()

No description

bool
localeHasDiffOneDayWords(mixed $locale)

No description

bool
localeHasDiffSyntax(mixed $locale)

No description

bool
localeHasDiffTwoDayWords(mixed $locale)

No description

bool
localeHasPeriodSyntax(mixed $locale)

No description

bool
localeHasShortUnits(mixed $locale)

No description

void
macro(mixed $name, mixed $macro)

No description

Carbon|null
make(mixed $var)

No description

maxValue()

No description

minValue()

No description

void
mixin(mixed $mixin)

No description

now(mixed $tz)

No description

parse(mixed $time, mixed $tz)

No description

string
pluralUnit(string $unit)

No description

void
resetMonthsOverflow()

No description

void
resetToStringFormat()

No description

void
resetYearsOverflow()

No description

void
serializeUsing(mixed $callback)

No description

void
setHumanDiffOptions(mixed $humanDiffOptions)

No description

bool
setLocale(mixed $locale)

No description

void
setMidDayAt(mixed $hour)

No description

void
setTestNow(mixed $testNow)

No description

void
setToStringFormat(mixed $format)

No description

void
setTranslator(TranslatorInterface $translator)

No description

void
setUtf8(mixed $utf8)

No description

void
setWeekEndsAt(mixed $day)

No description

void
setWeekStartsAt(mixed $day)

No description

void
setWeekendDays(mixed $days)

No description

bool
shouldOverflowMonths()

No description

bool
shouldOverflowYears()

No description

string
singularUnit(string $unit)

No description

today(mixed $tz)

No description

tomorrow(mixed $tz)

No description

void
useMonthsOverflow(mixed $monthsOverflow)

No description

void
useStrictMode(mixed $strictModeEnabled)

No description

void
useYearsOverflow(mixed $yearsOverflow)

No description

yesterday(mixed $tz)

No description

Details

static mixed use(mixed $handler)

Use the given handler when generating dates (class name, callable, or factory).

Parameters

mixed $handler

Return Value

mixed

Exceptions

InvalidArgumentException

static void useDefault()

Use the default date class when generating dates.

Return Value

void

static void useCallable(callable $callable)

Execute the given callable on each date creation.

Parameters

callable $callable

Return Value

void

static void useClass(string $dateClass)

Use the given date type (class) when generating dates.

Parameters

string $dateClass

Return Value

void

static void useFactory(object $factory)

Use the given Carbon factory when generating dates.

Parameters

object $factory

Return Value

void

mixed __call(string $method, array $parameters)

Handle dynamic calls to generate dates.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

RuntimeException

Carbon create(mixed $year, mixed $month, mixed $day, mixed $hour, mixed $minute, mixed $second, mixed $tz)

No description

Parameters

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

Return Value

Carbon

Carbon createFromDate(mixed $year, mixed $month, mixed $day, mixed $tz)

No description

Parameters

mixed $year
mixed $month
mixed $day
mixed $tz

Return Value

Carbon

Carbon|false createFromFormat(mixed $format, mixed $time, mixed $tz)

No description

Parameters

mixed $format
mixed $time
mixed $tz

Return Value

Carbon|false

Carbon createFromTime(mixed $hour, mixed $minute, mixed $second, mixed $tz)

No description

Parameters

mixed $hour
mixed $minute
mixed $second
mixed $tz

Return Value

Carbon

Carbon createFromTimeString(mixed $time, mixed $tz)

No description

Parameters

mixed $time
mixed $tz

Return Value

Carbon

Carbon createFromTimestamp(mixed $timestamp, mixed $tz)

No description

Parameters

mixed $timestamp
mixed $tz

Return Value

Carbon

Carbon createFromTimestampMs(mixed $timestamp, mixed $tz)

No description

Parameters

mixed $timestamp
mixed $tz

Return Value

Carbon

Carbon createFromTimestampUTC(mixed $timestamp)

No description

Parameters

mixed $timestamp

Return Value

Carbon

Carbon createMidnightDate(mixed $year, mixed $month, mixed $day, mixed $tz)

No description

Parameters

mixed $year
mixed $month
mixed $day
mixed $tz

Return Value

Carbon

Carbon|false createSafe(mixed $year, mixed $month, mixed $day, mixed $hour, mixed $minute, mixed $second, mixed $tz)

No description

Parameters

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

Return Value

Carbon|false

void disableHumanDiffOption(mixed $humanDiffOption)

No description

Parameters

mixed $humanDiffOption

Return Value

void

void enableHumanDiffOption(mixed $humanDiffOption)

No description

Parameters

mixed $humanDiffOption

Return Value

void

mixed executeWithLocale(mixed $locale, mixed $func)

No description

Parameters

mixed $locale
mixed $func

Return Value

mixed

Carbon fromSerialized(mixed $value)

No description

Parameters

mixed $value

Return Value

Carbon

array getAvailableLocales()

No description

Return Value

array

array getDays()

No description

Return Value

array

int getHumanDiffOptions()

No description

Return Value

int

array getIsoUnits()

No description

Return Value

array

array getLastErrors()

No description

Return Value

array

string getLocale()

No description

Return Value

string

int getMidDayAt()

No description

Return Value

int

Carbon|null getTestNow()

No description

Return Value

Carbon|null

TranslatorInterface getTranslator()

No description

Return Value

TranslatorInterface

int getWeekEndsAt()

No description

Return Value

int

int getWeekStartsAt()

No description

Return Value

int

array getWeekendDays()

No description

Return Value

array

bool hasFormat(mixed $date, mixed $format)

No description

Parameters

mixed $date
mixed $format

Return Value

bool

bool hasMacro(mixed $name)

No description

Parameters

mixed $name

Return Value

bool

bool hasRelativeKeywords(mixed $time)

No description

Parameters

mixed $time

Return Value

bool

bool hasTestNow()

No description

Return Value

bool

Carbon instance(mixed $date)

No description

Parameters

mixed $date

Return Value

Carbon

bool isImmutable()

No description

Return Value

bool

bool isModifiableUnit(mixed $unit)

No description

Parameters

mixed $unit

Return Value

bool

bool isMutable()

No description

Return Value

bool

bool isStrictModeEnabled()

No description

Return Value

bool

bool localeHasDiffOneDayWords(mixed $locale)

No description

Parameters

mixed $locale

Return Value

bool

bool localeHasDiffSyntax(mixed $locale)

No description

Parameters

mixed $locale

Return Value

bool

bool localeHasDiffTwoDayWords(mixed $locale)

No description

Parameters

mixed $locale

Return Value

bool

bool localeHasPeriodSyntax(mixed $locale)

No description

Parameters

mixed $locale

Return Value

bool

bool localeHasShortUnits(mixed $locale)

No description

Parameters

mixed $locale

Return Value

bool

void macro(mixed $name, mixed $macro)

No description

Parameters

mixed $name
mixed $macro

Return Value

void

Carbon|null make(mixed $var)

No description

Parameters

mixed $var

Return Value

Carbon|null

Carbon maxValue()

No description

Return Value

Carbon

Carbon minValue()

No description

Return Value

Carbon

void mixin(mixed $mixin)

No description

Parameters

mixed $mixin

Return Value

void

Carbon now(mixed $tz)

No description

Parameters

mixed $tz

Return Value

Carbon

Carbon parse(mixed $time, mixed $tz)

No description

Parameters

mixed $time
mixed $tz

Return Value

Carbon

string pluralUnit(string $unit)

No description

Parameters

string $unit

Return Value

string

void resetMonthsOverflow()

No description

Return Value

void

void resetToStringFormat()

No description

Return Value

void

void resetYearsOverflow()

No description

Return Value

void

void serializeUsing(mixed $callback)

No description

Parameters

mixed $callback

Return Value

void

void setHumanDiffOptions(mixed $humanDiffOptions)

No description

Parameters

mixed $humanDiffOptions

Return Value

void

bool setLocale(mixed $locale)

No description

Parameters

mixed $locale

Return Value

bool

void setMidDayAt(mixed $hour)

No description

Parameters

mixed $hour

Return Value

void

void setTestNow(mixed $testNow)

No description

Parameters

mixed $testNow

Return Value

void

void setToStringFormat(mixed $format)

No description

Parameters

mixed $format

Return Value

void

void setTranslator(TranslatorInterface $translator)

No description

Parameters

TranslatorInterface $translator

Return Value

void

void setUtf8(mixed $utf8)

No description

Parameters

mixed $utf8

Return Value

void

void setWeekEndsAt(mixed $day)

No description

Parameters

mixed $day

Return Value

void

void setWeekStartsAt(mixed $day)

No description

Parameters

mixed $day

Return Value

void

void setWeekendDays(mixed $days)

No description

Parameters

mixed $days

Return Value

void

bool shouldOverflowMonths()

No description

Return Value

bool

bool shouldOverflowYears()

No description

Return Value

bool

string singularUnit(string $unit)

No description

Parameters

string $unit

Return Value

string

Carbon today(mixed $tz)

No description

Parameters

mixed $tz

Return Value

Carbon

Carbon tomorrow(mixed $tz)

No description

Parameters

mixed $tz

Return Value

Carbon

void useMonthsOverflow(mixed $monthsOverflow)

No description

Parameters

mixed $monthsOverflow

Return Value

void

void useStrictMode(mixed $strictModeEnabled)

No description

Parameters

mixed $strictModeEnabled

Return Value

void

void useYearsOverflow(mixed $yearsOverflow)

No description

Parameters

mixed $yearsOverflow

Return Value

void

Carbon yesterday(mixed $tz)

No description

Parameters

mixed $tz

Return Value

Carbon