PHP Класс Jenssegers\Date\Date

Наследование: extends Carbon\Carbon
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$fallbackLocale string The fallback locale when a locale is not available.
$lastErrors array The errors that can occur.
$translator Symfony\Component\Translation\Translator The Translator implementation.

Открытые методы

Метод Описание
__construct ( string $time = null, string | DateTimeZon\DateTimeZone $timezone = null ) : Date Returns new DateTime object.
add ( string | DateInterva\DateInterval $interval ) : Date Adds an amount of days, months, years, hours, minutes and seconds to a Date object.
ago ( Date $since = null, boolean $absolute = false ) : string Alias for diffForHumans.
createFromFormat ( string $format, string $time, DateTimeZon\DateTimeZone | string $timezone = null ) : static Create a Carbon instance from a specific format.
diffForHumans ( Carbon\Carbon $since = null, boolean $absolute = false, $short = false ) : string Get the difference in a human readable format.
format ( string $format ) : string Returns date formatted according to given or predefined format.
getFallbackLocale ( ) : string Get the fallback locale.
getLocale ( ) : string Get the current translator locale.
getTranslator ( ) : Translator Return the Translator implementation.
make ( string $time = null, string | DateTimeZon\DateTimeZone $timezone = null ) : Date Create and return new Date instance.
parse ( string $time = null, string | DateTimeZon\DateTimeZone $timezone = null ) : Date Create a carbon instance from a string.
setFallbackLocale ( string $locale ) : void Set the fallback locale.
setLocale ( string $locale ) : void Set the current locale.
setTranslator ( Symfony\Component\Translation\TranslatorInterface $translator ) Set the Translator implementation.
sub ( string | DateInterva\DateInterval $interval ) : Date Subtracts an amount of days, months, years, hours, minutes and seconds from a DateTime object.
timespan ( Date $time = null, string | DateTimeZon\DateTimeZone $timezone = null ) : integer Gets the timespan between this date and another date.
translateTimeString ( string $time ) : string Translate a locale based time string to its english equivalent.
until ( Date $since = null ) : string Alias for diffForHumans.

Описание методов

__construct() публичный Метод

Returns new DateTime object.
public __construct ( string $time = null, string | DateTimeZon\DateTimeZone $timezone = null ) : Date
$time string
$timezone string | DateTimeZon\DateTimeZone
Результат Date

add() публичный Метод

Adds an amount of days, months, years, hours, minutes and seconds to a Date object.
public add ( string | DateInterva\DateInterval $interval ) : Date
$interval string | DateInterva\DateInterval
Результат Date

ago() публичный Метод

Alias for diffForHumans.
public ago ( Date $since = null, boolean $absolute = false ) : string
$since Date
$absolute boolean Removes time difference modifiers ago, after, etc
Результат string

createFromFormat() публичный статический Метод

Create a Carbon instance from a specific format.
public static createFromFormat ( string $format, string $time, DateTimeZon\DateTimeZone | string $timezone = null ) : static
$format string
$time string
$timezone DateTimeZon\DateTimeZone | string
Результат static

diffForHumans() публичный Метод

Get the difference in a human readable format.
public diffForHumans ( Carbon\Carbon $since = null, boolean $absolute = false, $short = false ) : string
$since Carbon\Carbon
$absolute boolean Removes time difference modifiers ago, after, etc
Результат string

format() публичный Метод

Returns date formatted according to given or predefined format.
public format ( string $format ) : string
$format string
Результат string

getFallbackLocale() публичный статический Метод

Get the fallback locale.
public static getFallbackLocale ( ) : string
Результат string

getLocale() публичный статический Метод

Get the current translator locale.
public static getLocale ( ) : string
Результат string

getTranslator() публичный статический Метод

Return the Translator implementation.
public static getTranslator ( ) : Translator
Результат Symfony\Component\Translation\Translator

make() публичный статический Метод

Create and return new Date instance.
public static make ( string $time = null, string | DateTimeZon\DateTimeZone $timezone = null ) : Date
$time string
$timezone string | DateTimeZon\DateTimeZone
Результат Date

parse() публичный статический Метод

Create a carbon instance from a string.
public static parse ( string $time = null, string | DateTimeZon\DateTimeZone $timezone = null ) : Date
$time string
$timezone string | DateTimeZon\DateTimeZone
Результат Date

setFallbackLocale() публичный статический Метод

Set the fallback locale.
public static setFallbackLocale ( string $locale ) : void
$locale string
Результат void

setLocale() публичный статический Метод

Set the current locale.
public static setLocale ( string $locale ) : void
$locale string
Результат void

setTranslator() публичный статический Метод

Set the Translator implementation.
public static setTranslator ( Symfony\Component\Translation\TranslatorInterface $translator )
$translator Symfony\Component\Translation\TranslatorInterface

sub() публичный Метод

Subtracts an amount of days, months, years, hours, minutes and seconds from a DateTime object.
public sub ( string | DateInterva\DateInterval $interval ) : Date
$interval string | DateInterva\DateInterval
Результат Date

timespan() публичный Метод

Gets the timespan between this date and another date.
public timespan ( Date $time = null, string | DateTimeZon\DateTimeZone $timezone = null ) : integer
$time Date
$timezone string | DateTimeZon\DateTimeZone
Результат integer

translateTimeString() публичный статический Метод

Translate a locale based time string to its english equivalent.
public static translateTimeString ( string $time ) : string
$time string
Результат string

until() публичный Метод

Alias for diffForHumans.
public until ( Date $since = null ) : string
$since Date
Результат string

Описание свойств

$fallbackLocale защищенное статическое свойство

The fallback locale when a locale is not available.
protected static string $fallbackLocale
Результат string

$lastErrors защищенное статическое свойство

The errors that can occur.
protected static array $lastErrors
Результат array

$translator защищенное статическое свойство

The Translator implementation.
protected static Translator,Symfony\Component\Translation $translator
Результат Symfony\Component\Translation\Translator