Korin API

Date
in package

Read onlyYes
FinalYes

One calendar date of a {@see GedcomDate}: a year, optionally a month and a day, in a calendar. Calendars, months and epochs are GEDCOM tags, written the same for every version: the 5.x escape "@#DFRENCH R@" is FRENCH_R, "B.C." is the epoch BCE. A 7.0 extension calendar, month or epoch keeps its tag ("_MAYA"). A dual year ("1648/49", 5.x only) keeps both years.

A day and month without a year ("23 AUG") is a 5.5.5 Gregorian date. Whether the date exists in its calendar is checked when a GedcomDate is parsed or written.

Table of Contents

Constants

BCE  : mixed = 'BCE'
FRENCH_R  : mixed = 'FRENCH_R'
GREGORIAN  : mixed = 'GREGORIAN'
HEBREW  : mixed = 'HEBREW'
JULIAN  : mixed = 'JULIAN'
MAX_YEAR  : mixed = 999999999
The largest year: Julian Day Numbers of larger ones would overflow an int.
ROMAN  : mixed = 'ROMAN'
5.x @#DROMAN@ and @#DUNKNOWN@, calendars "for future definition".
UNKNOWN  : mixed = 'UNKNOWN'

Properties

$calendar  : string
$day  : int|null
$dualYear  : int|null
$epoch  : string|null
$month  : string|null
$year  : int|null

Methods

__construct()  : mixed
days()  : array{int, int}|null
The days the date can mean, as Julian Day Numbers: "1907" is 1 JAN to 31 DEC 1907. Only for Gregorian and Julian dates with a year from 4001 BCE to 9999 and a standard month; a dual year counts as its second year.
isBce()  : bool
of()  : self
year()  : int

Constants

BCE

public mixed BCE = 'BCE'

FRENCH_R

public mixed FRENCH_R = 'FRENCH_R'

GREGORIAN

public mixed GREGORIAN = 'GREGORIAN'

HEBREW

public mixed HEBREW = 'HEBREW'

JULIAN

public mixed JULIAN = 'JULIAN'

MAX_YEAR

The largest year: Julian Day Numbers of larger ones would overflow an int.

public mixed MAX_YEAR = 999999999

ROMAN

5.x @#DROMAN@ and @#DUNKNOWN@, calendars "for future definition".

public mixed ROMAN = 'ROMAN'

UNKNOWN

public mixed UNKNOWN = 'UNKNOWN'

Properties

$calendar

public string $calendar = self::GREGORIAN

$day

public int|null $day = null

$dualYear

public int|null $dualYear = null

$epoch

public string|null $epoch = null

$month

public string|null $month = null

$year

public int|null $year

Methods

__construct()

public __construct(int|null $year[, string|null $month = null ][, int|null $day = null ][, string $calendar = self::GREGORIAN ][, string|null $epoch = null ][, int|null $dualYear = null ]) : mixed
Parameters
$year : int|null

0 to MAX_YEAR; the grammars allow years of any length, which a Date cannot hold

$month : string|null = null
$day : int|null = null
$calendar : string = self::GREGORIAN
$epoch : string|null = null
$dualYear : int|null = null

the year by a 1 January new year: 1649 for "1648/49"

days()

The days the date can mean, as Julian Day Numbers: "1907" is 1 JAN to 31 DEC 1907. Only for Gregorian and Julian dates with a year from 4001 BCE to 9999 and a standard month; a dual year counts as its second year.

public days() : array{int, int}|null
Return values
array{int, int}|null

isBce()

public isBce() : bool
Return values
bool

of()

public static of(int|null $year[, string|null $month = null ][, int|null $day = null ][, string $calendar = self::GREGORIAN ]) : self
Parameters
$year : int|null
$month : string|null = null
$day : int|null = null
$calendar : string = self::GREGORIAN
Return values
self

year()

public static year(string $digits) : int
Parameters
$digits : string
Tags
throws
InvalidValueException

for a year above MAX_YEAR

Return values
int
On this page

Search results