Era
in package
Class Era Tarih yapılandırma sınıfı
Table of Contents
- ATOM = 'Y-m-d\TH:i:sP'
- COOKIE = 'l, d-M-Y H:i:s T'
- FTIME = [ //Day "d" => "%d", "D" => "%a", "j" => "%e", "l" => "%A", "N" => "%u", "S" => "S", "w" => "%w", "z" => "%j", //Week "W" => "%W", //Month "F" => "%B", "m" => "%m", "M" => "%b", "n" => "%U", "t" => "t", //Year "L" => "L", "o" => "%g", "Y" => "%Y", "y" => "%y", //Time "a" => "%P", "A" => "%p", "B" => "B", "g" => "%l", "G" => "%k", "h" => "%I", "H" => "%H", "i" => "%M", "s" => "%S", "u" => "u", "v" => "v", //Timezone "e" => "e", "I" => "I", "O" => "%z", "P" => "P", "p" => "p", "T" => "T", "Z" => "Z", //Full Date/Time "c" => "%Y-%m-%d\T%TP", "r" => "%a, %d %b %G %X %z", "U" => "%s", ]
- ISO8601 = 'Y-m-d\TH:i:sO'
- LOCALE_DATE_FORMAT = "%x"
- LOCALE_DATETIME_FORMAT = "%x H:i:s"
- RFC1036 = 'D, d M y H:i:s O'
- RFC1123 = 'D, d M Y H:i:s O'
- RFC2822 = 'D, d M Y H:i:s O'
- RFC3339 = 'Y-m-d\TH:i:sP'
- RFC3339_EXTENDED = 'Y-m-d\TH:i:s.vP'
- RFC7231 = 'D, d M Y H:i:s \G\M\T'
- RFC822 = 'D, d M y H:i:s O'
- RFC850 = 'l, d-M-y H:i:s T'
- RSS = 'D, d M Y H:i:s O'
- SQL = "Y-m-d H:i:s"
- SQLMS = "Y-m-d H:i:s.u"
- TEXT_BASED_DATE = "d F Y l"
- TEXT_BASED_DATE_SHORT = "d F Y"
- TEXT_BASED_DATETIME = "d F Y l H:i"
- TEXT_BASED_DATETIME_SHORT = "d F Y H:i"
- W3C = 'Y-m-d\TH:i:sP'
- $HUMAN_TEXT : array<string|int, mixed>
- $lang_dir : string
- $dateTime : DateTime
- $format : string
- $locale : string
- __construct() : mixed
- Date constructor.
- __toString() : string
- __wakeup() : void
- DateTimeInterface __wakeup()
- add() : $this
- İlk parametre int yıl veya DateInterval
- addDay() : self
- addHour() : $this
- addMilliSecond() : $this
- addminut() : $this
- addMonth() : self
- addSecond() : $this
- addWeek() : self
- addYear() : self
- age() : int
- create() : Era
- createFromFormat() : Era
- dateIntervalTo() : int
- diff() : DateInterval|false
- diffDay() : int
- diffDays() : int
- diffHour() : int
- diffMilliSecond() : float
- diffMinute() : int
- diffMonth() : int
- diffSecond() : int
- diffYear() : int
- format() : string
- formatLocale() : false|string
- LC_TIME ile belirtilen dilde tarih çevirisi
- getDate() : string
- getDateTime() : DateTime
- getOffset() : int
- getTime() : string
- getTimestamp() : int
- getTimezone() : DateTimeZone
- humanDiff() : false|string
- locale() : Era|string
- now() : static
- parse() : Era
- setDate() : self
- setISODate() : $this
- setTime() : $this
- setTimestamp() : $this
- setTimezone() : $this
- sub() : $this
- subDay() : self
- subHour() : $this
- subMilliSecond() : $this
- subMinut() : $this
- subMonth() : self
- subSecond() : $this
- subWeek() : self
- subYear() : self
- today() : static
- tomorrow() : static
- yesterday() : static
- formatDateToStrftime() : string
- humanPlaceholder() : string
Constants
ATOM
public
mixed
ATOM
= 'Y-m-d\TH:i:sP'
Tags
COOKIE
public
mixed
COOKIE
= 'l, d-M-Y H:i:s T'
Tags
FTIME
public
mixed
FTIME
= [
//Day
"d" => "%d",
"D" => "%a",
"j" => "%e",
"l" => "%A",
"N" => "%u",
"S" => "S",
"w" => "%w",
"z" => "%j",
//Week
"W" => "%W",
//Month
"F" => "%B",
"m" => "%m",
"M" => "%b",
"n" => "%U",
"t" => "t",
//Year
"L" => "L",
"o" => "%g",
"Y" => "%Y",
"y" => "%y",
//Time
"a" => "%P",
"A" => "%p",
"B" => "B",
"g" => "%l",
"G" => "%k",
"h" => "%I",
"H" => "%H",
"i" => "%M",
"s" => "%S",
"u" => "u",
"v" => "v",
//Timezone
"e" => "e",
"I" => "I",
"O" => "%z",
"P" => "P",
"p" => "p",
"T" => "T",
"Z" => "Z",
//Full Date/Time
"c" => "%Y-%m-%d\T%TP",
"r" => "%a, %d %b %G %X %z",
"U" => "%s",
]
ISO8601
public
mixed
ISO8601
= 'Y-m-d\TH:i:sO'
Tags
LOCALE_DATE_FORMAT
public
string
LOCALE_DATE_FORMAT
= "%x"
Locale format
LOCALE_DATETIME_FORMAT
public
string
LOCALE_DATETIME_FORMAT
= "%x H:i:s"
Locale format
RFC1036
public
mixed
RFC1036
= 'D, d M y H:i:s O'
Tags
RFC1123
public
mixed
RFC1123
= 'D, d M Y H:i:s O'
Tags
RFC2822
public
mixed
RFC2822
= 'D, d M Y H:i:s O'
Tags
RFC3339
public
mixed
RFC3339
= 'Y-m-d\TH:i:sP'
Tags
RFC3339_EXTENDED
public
mixed
RFC3339_EXTENDED
= 'Y-m-d\TH:i:s.vP'
Tags
RFC7231
public
mixed
RFC7231
= 'D, d M Y H:i:s \G\M\T'
Tags
RFC822
public
mixed
RFC822
= 'D, d M y H:i:s O'
Tags
RFC850
public
mixed
RFC850
= 'l, d-M-y H:i:s T'
Tags
RSS
public
mixed
RSS
= 'D, d M Y H:i:s O'
Tags
SQL
public
string
SQL
= "Y-m-d H:i:s"
SQL DateTime format
SQLMS
public
string
SQLMS
= "Y-m-d H:i:s.u"
SQL DateTime format
TEXT_BASED_DATE
public
string
TEXT_BASED_DATE
= "d F Y l"
05 October 2021 Tuesday
TEXT_BASED_DATE_SHORT
public
string
TEXT_BASED_DATE_SHORT
= "d F Y"
05 October 2021
TEXT_BASED_DATETIME
public
string
TEXT_BASED_DATETIME
= "d F Y l H:i"
05 October 2021 Tuesday 21:30
TEXT_BASED_DATETIME_SHORT
public
string
TEXT_BASED_DATETIME_SHORT
= "d F Y H:i"
05 October 2021 Tuesday
W3C
public
mixed
W3C
= 'Y-m-d\TH:i:sP'
Tags
Properties
$HUMAN_TEXT
public
static array<string|int, mixed>
$HUMAN_TEXT
= ['C' => ['year' => '%d year :ph|%d years :ph', 'month' => '%d month :ph|%d months :ph', 'week' => '%d week :ph|%d weeks :ph', 'day' => '%d day :ph|%d days :ph', 'hour' => '%d hour :ph|%d hours :ph', 'minute' => '%d minute :ph|%d minutes :ph', 'second' => '%d second :ph|%d seconds :ph', ':ph-before' => 'ago', ':ph-after' => 'later', ':ph-empty' => '']]
$lang_dir
public
static string
$lang_dir
= __DIR__ . '/lang'
$dateTime
protected
DateTime
$dateTime
$format
protected
string
$format
= self::SQL
$locale
protected
string
$locale
Methods
__construct()
Date constructor.
public
__construct([string $datetime = 'now' ][, null $timezone = null ]) : mixed
Parameters
- $datetime : string = 'now'
- $timezone : null = null
Tags
Return values
mixed —__toString()
public
__toString() : string
Return values
string —__wakeup()
DateTimeInterface __wakeup()
public
__wakeup() : void
Return values
void —add()
İlk parametre int yıl veya DateInterval
public
add(int|DateInterval $year, int $month, int $day, int $hour, int $minute, int $second) : $this
Parameters
- $year : int|DateInterval
- $month : int
- $day : int
- $hour : int
- $minute : int
- $second : int
Return values
$this —addDay()
public
addDay(int $day) : self
Parameters
- $day : int
Return values
self —addHour()
public
addHour(int $hour) : $this
Parameters
- $hour : int
Return values
$this —addMilliSecond()
public
addMilliSecond(int $millisecond) : $this
Parameters
- $millisecond : int
Return values
$this —addminut()
public
addminut(int $minute) : $this
Parameters
- $minute : int
Return values
$this —addMonth()
public
addMonth(int $month) : self
Parameters
- $month : int
Return values
self —addSecond()
public
addSecond(int $second) : $this
Parameters
- $second : int
Return values
$this —addWeek()
public
addWeek(int $week) : self
Parameters
- $week : int
Return values
self —addYear()
public
addYear(int $year) : self
Parameters
- $year : int
Return values
self —age()
public
age() : int
Tags
Return values
int —create()
public
static create(int $year, int $month, int $day, int $hour, int $minute, int $second, int $milisecond) : Era
Parameters
- $year : int
- $month : int
- $day : int
- $hour : int
- $minute : int
- $second : int
- $milisecond : int
Return values
Era —createFromFormat()
public
static createFromFormat(string $format, string $datetime) : Era
Parameters
- $format : string
- $datetime : string
Tags
Return values
Era —dateIntervalTo()
public
static dateIntervalTo(DateInterval $dateInterval[, mixed $unit = "day" ]) : int
Parameters
- $dateInterval : DateInterval
- $unit : mixed = "day"
Return values
int —diff()
public
diff(DateTimeInterface|Era|string $targetDate[, bool $absolute = true ]) : DateInterval|false
Parameters
- $targetDate : DateTimeInterface|Era|string
- $absolute : bool = true
-
default true
Return values
DateInterval|false —diffDay()
public
diffDay(DateTimeInterface|Era|string $targetDate[, bool $absolute = true ]) : int
Parameters
- $targetDate : DateTimeInterface|Era|string
- $absolute : bool = true
Return values
int —diffDays()
public
diffDays(DateTimeInterface|Era|string $targetDate[, bool $absolute = true ]) : int
Parameters
- $targetDate : DateTimeInterface|Era|string
- $absolute : bool = true
Return values
int —diffHour()
public
diffHour(DateTimeInterface|Era|string $targetDate[, bool $absolute = true ]) : int
Parameters
- $targetDate : DateTimeInterface|Era|string
- $absolute : bool = true
Return values
int —diffMilliSecond()
public
diffMilliSecond(DateTimeInterface|Era|string $targetDate[, bool $absolute = true ]) : float
Parameters
- $targetDate : DateTimeInterface|Era|string
- $absolute : bool = true
Return values
float —diffMinute()
public
diffMinute(DateTimeInterface|Era|string $targetDate[, bool $absolute = true ]) : int
Parameters
- $targetDate : DateTimeInterface|Era|string
- $absolute : bool = true
Return values
int —diffMonth()
public
diffMonth(DateTimeInterface|Era|string $targetDate[, bool $absolute = true ]) : int
Parameters
- $targetDate : DateTimeInterface|Era|string
- $absolute : bool = true
Return values
int —diffSecond()
public
diffSecond(DateTimeInterface|Era|string $targetDate[, bool $absolute = true ]) : int
Parameters
- $targetDate : DateTimeInterface|Era|string
- $absolute : bool = true
Return values
int —diffYear()
public
diffYear(DateTimeInterface|Era|string $targetDate[, bool $absolute = true ]) : int
Parameters
- $targetDate : DateTimeInterface|Era|string
- $absolute : bool = true
Return values
int —format()
public
format([string $format = Era::SQL ]) : string
Parameters
- $format : string = Era::SQL
Return values
string —formatLocale()
LC_TIME ile belirtilen dilde tarih çevirisi
public
formatLocale([string $format = Era::TEXT_BASED_DATETIME_SHORT ]) : false|string
Parameters
- $format : string = Era::TEXT_BASED_DATETIME_SHORT
Return values
false|string —getDate()
public
getDate([mixed $format = Era::LOCALE_DATE_FORMAT ]) : string
Parameters
- $format : mixed = Era::LOCALE_DATE_FORMAT
Return values
string —getDateTime()
public
getDateTime() : DateTime
Return values
DateTime —getOffset()
public
getOffset() : int
Return values
int —getTime()
public
getTime([string $format = "H:i:s" ]) : string
Parameters
- $format : string = "H:i:s"
Return values
string —getTimestamp()
public
getTimestamp() : int
Return values
int —getTimezone()
public
getTimezone() : DateTimeZone
Return values
DateTimeZone —humanDiff()
public
humanDiff([bool $short = false ]) : false|string
Parameters
- $short : bool = false
Return values
false|string —locale()
public
locale([string|null $locale = null ]) : Era|string
Parameters
- $locale : string|null = null
Return values
Era|string —now()
public
static now([null $timezone = null ]) : static
Parameters
- $timezone : null = null
Tags
Return values
static —parse()
public
static parse(string $dateTime) : Era
Parameters
- $dateTime : string
Tags
Return values
Era —setDate()
public
setDate(int $year, int $month, int $day) : self
Parameters
- $year : int
- $month : int
- $day : int
Return values
self —setISODate()
public
setISODate(int $year, int $week[, int $dayOfWeek = 1 ]) : $this
Parameters
- $year : int
- $week : int
- $dayOfWeek : int = 1
Return values
$this —setTime()
public
setTime(int $hour, int $minute, int $second, int $microsecond) : $this
Parameters
- $hour : int
- $minute : int
- $second : int
- $microsecond : int
Return values
$this —setTimestamp()
public
setTimestamp(int $timestamp) : $this
Parameters
- $timestamp : int
Return values
$this —setTimezone()
public
setTimezone( $timezone) : $this
Parameters
Return values
$this —sub()
public
sub(int|DateInterval $year, int $month, int $day, int $hour, int $minute, int $second) : $this
Parameters
- $year : int|DateInterval
- $month : int
- $day : int
- $hour : int
- $minute : int
- $second : int
Return values
$this —subDay()
public
subDay(int $day) : self
Parameters
- $day : int
Return values
self —subHour()
public
subHour(int $hour) : $this
Parameters
- $hour : int
Return values
$this —subMilliSecond()
public
subMilliSecond(int $millisecond) : $this
Parameters
- $millisecond : int
Return values
$this —subMinut()
public
subMinut(int $minute) : $this
Parameters
- $minute : int
Return values
$this —subMonth()
public
subMonth(int $month) : self
Parameters
- $month : int
Return values
self —subSecond()
public
subSecond(int $second) : $this
Parameters
- $second : int
Return values
$this —subWeek()
public
subWeek(int $week) : self
Parameters
- $week : int
Return values
self —subYear()
public
subYear(int $year) : self
Parameters
- $year : int
Return values
self —today()
public
static today([null $timezone = null ]) : static
Parameters
- $timezone : null = null
Tags
Return values
static —tomorrow()
public
static tomorrow([null $timezone = null ]) : static
Parameters
- $timezone : null = null
Tags
Return values
static —yesterday()
public
static yesterday([null $timezone = null ]) : static
Parameters
- $timezone : null = null
Tags
Return values
static —formatDateToStrftime()
protected
formatDateToStrftime( $format) : string
Parameters
Return values
string —humanPlaceholder()
private
humanPlaceholder(string $key, int $unit, int $invert, bool $short) : string
Parameters
- $key : string
- $unit : int
- $invert : int
- $short : bool