PHP 클래스 Jenssegers\Date\Date

상속: extends Carbon\Carbon
파일 보기 프로젝트 열기: jenssegers/date 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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