Quittio 0.3 API

Date
in package
implements JsonSerializable, Stringable

Read onlyYes
FinalYes

Calendar date without time of day.

Invoice dates are legal dates in the issuer's time zone. Storing them as year/month/day makes it impossible for a UTC conversion to shift them to the previous or next day.

Table of Contents

Interfaces

JsonSerializable
Stringable

Properties

$day  : int
$month  : int
$year  : int

Methods

__toString()  : string
addDays()  : self
compareTo()  : int
diffInDays()  : int
equals()  : bool
format()  : string
fromFormat102()  : self
Strict CII date in format 102 (YYYYMMDD), as used for incoming documents.
fromIsoDate()  : self
Strict ISO 8601 calendar date (YYYY-MM-DD) with an optional time zone (Z, +01:00), as used by UBL (xs:date). The time zone does not shift the calendar date.
isAfter()  : bool
isBefore()  : bool
jsonSerialize()  : string
of()  : self
parse()  : self
Accepts ISO dates (2026-10-03), the CII format 102 (20261003), date-time strings and DateTimeInterface instances.
toCarbon()  : CarbonImmutable
today()  : self
toFormat102()  : string
Date in UN/CEFACT format 102 (CCYYMMDD).
toIsoString()  : string

Properties

$month

public int $month

Methods

__toString()

public __toString() : string
Return values
string

addDays()

public addDays(int $days) : self
Parameters
$days : int
Return values
self

compareTo()

public compareTo(self $other) : int
Parameters
$other : self
Return values
int

diffInDays()

public diffInDays(self $other) : int
Parameters
$other : self
Return values
int

equals()

public equals(self $other) : bool
Parameters
$other : self
Return values
bool

format()

public format(string $format) : string
Parameters
$format : string
Return values
string

fromFormat102()

Strict CII date in format 102 (YYYYMMDD), as used for incoming documents.

public static fromFormat102(string $value) : self
Parameters
$value : string
Tags
throws
InvalidArgumentException
Return values
self

fromIsoDate()

Strict ISO 8601 calendar date (YYYY-MM-DD) with an optional time zone (Z, +01:00), as used by UBL (xs:date). The time zone does not shift the calendar date.

public static fromIsoDate(string $value) : self
Parameters
$value : string
Tags
throws
InvalidArgumentException
Return values
self

isAfter()

public isAfter(self $other) : bool
Parameters
$other : self
Return values
bool

isBefore()

public isBefore(self $other) : bool
Parameters
$other : self
Return values
bool

jsonSerialize()

public jsonSerialize() : string
Return values
string

of()

public static of(int $year, int $month, int $day) : self
Parameters
$year : int
$month : int
$day : int
Return values
self

parse()

Accepts ISO dates (2026-10-03), the CII format 102 (20261003), date-time strings and DateTimeInterface instances.

public static parse(self|DateTimeInterface|string $value[, DateTimeZone|string|null $timezone = null ]) : self

A DateTimeInterface is first converted into $timezone (if given), so that the calendar date matches the issuer's local date.

Parameters
$value : self|DateTimeInterface|string
$timezone : DateTimeZone|string|null = null
Return values
self

toCarbon()

public toCarbon([DateTimeZone|string|null $timezone = null ]) : CarbonImmutable
Parameters
$timezone : DateTimeZone|string|null = null
Return values
CarbonImmutable

today()

public static today([DateTimeZone|string|null $timezone = null ]) : self
Parameters
$timezone : DateTimeZone|string|null = null
Return values
self

toFormat102()

Date in UN/CEFACT format 102 (CCYYMMDD).

public toFormat102() : string
Return values
string

toIsoString()

public toIsoString() : string
Return values
string
On this page

Search results