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 $timezone)
No description
createFromDate(mixed $year, mixed $month, mixed $day, mixed $timezone)
No description
createFromTime(mixed $hour, mixed $minute, mixed $second, mixed $timezone)
No description
createSafe(mixed $year, mixed $month, mixed $day, mixed $hour, mixed $minute, mixed $second, mixed $timezone)
No description
bool
hasFormat(mixed $date, mixed $format)
No description
void
macro(mixed $name, mixed $macro)
No description
make(mixed $var)
No description
void
mixin(mixed $mixin)
No description
now(mixed $timezone)
No description
parse(mixed $time, mixed $timezone)
No description
void
setUtf8(mixed $utf8)
No description
today(mixed $timezone)
No description
tomorrow(mixed $timezone)
No description
Details
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.
Carbon
create(mixed $year, mixed $month, mixed $day, mixed $hour, mixed $minute, mixed $second, mixed $timezone)
Carbon
createFromDate(mixed $year, mixed $month, mixed $day, mixed $timezone)
Carbon
createFromTime(mixed $hour, mixed $minute, mixed $second, mixed $timezone)
Carbon
createFromTimeString(mixed $time, mixed $timezone)
Carbon
createFromTimestamp(mixed $timestamp, mixed $timezone)
Carbon
createFromTimestampMs(mixed $timestamp, mixed $timezone)
Carbon
createFromTimestampUTC(mixed $timestamp)
Carbon
createMidnightDate(mixed $year, mixed $month, mixed $day, mixed $timezone)
Carbon|false
createSafe(mixed $year, mixed $month, mixed $day, mixed $hour, mixed $minute, mixed $second, mixed $timezone)
void
disableHumanDiffOption(mixed $humanDiffOption)
void
enableHumanDiffOption(mixed $humanDiffOption)
mixed
executeWithLocale(mixed $locale, mixed $func)
array
getAvailableLocales()
int
getHumanDiffOptions()
TranslatorInterface
getTranslator()
bool
hasMacro(mixed $name)
bool
hasRelativeKeywords(mixed $time)
bool
isModifiableUnit(mixed $unit)
bool
isStrictModeEnabled()
bool
localeHasDiffOneDayWords(mixed $locale)
bool
localeHasDiffSyntax(mixed $locale)
bool
localeHasDiffTwoDayWords(mixed $locale)
bool
localeHasPeriodSyntax(mixed $locale)
bool
localeHasShortUnits(mixed $locale)
void
macro(mixed $name, mixed $macro)
Carbon|null
make(mixed $var)
Carbon
parse(mixed $time, mixed $timezone)
string
pluralUnit(string $unit)
void
resetMonthsOverflow()
void
resetYearsOverflow()
void
serializeUsing(mixed $callback)
void
setHumanDiffOptions(mixed $humanDiffOptions)
bool
setLocale(mixed $locale)
void
setMidDayAt(mixed $hour)
void
setTestNow(mixed $testNow)
void
setTranslator(TranslatorInterface $translator)
void
setUtf8(mixed $utf8)
void
setWeekEndsAt(mixed $day)
void
setWeekStartsAt(mixed $day)
void
setWeekendDays(mixed $days)
bool
shouldOverflowMonths()
bool
shouldOverflowYears()
string
singularUnit(string $unit)
void
useMonthsOverflow(mixed $monthsOverflow)
void
useStrictMode(mixed $strictModeEnabled)
void
useYearsOverflow(mixed $yearsOverflow)