---
title: "Date – API-Referenz · Quittio"
description: "Calendar date without time of day."
canonical_url: "https://quittio.dev/docs/api/Quittio/Core/Support/Date"
locale: de
meta:
  "og:description": "Calendar date without time of day."
  "og:image": "https://quittio.dev/og/quittio-de.jpg"
  "og:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
  "og:image:height": "630"
  "og:image:type": image/jpeg
  "og:image:width": "1200"
  "og:title": "Date – API-Referenz · Quittio"
  "twitter:image": "https://quittio.dev/og/quittio-de.jpg"
  "twitter:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
---

> Index of every page on this site: [llms.txt](https://quittio.dev/llms.txt)

[API reference](https://quittio.dev/docs/api) / [Quittio](https://quittio.dev/docs/api/Quittio) \\ [Core](https://quittio.dev/docs/api/Quittio/Core) \\ [Support](https://quittio.dev/docs/api/Quittio/Core/Support)

# Date

final readonly class in quittio/core · implements `JsonSerializable`, `Stringable`

`Quittio\Core\Support\Date` · [Source](https://github.com/Quittio/quittio/blob/v0.7.1/packages/core/src/Support/Date.php#L22)

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.

## Methods \#

| Method | Description |
| --- | --- |
| `->__toString()` | |
| `->addDays()` | |
| `->compareTo()` | |
| `->diffInDays()` | |
| `->equals()` | |
| `->format()` | |
| `::fromFormat102()` | Strict CII date in format 102 (YYYYMMDD), as used for incoming documents. |
| `::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. |
| `->isAfter()` | |
| `->isBefore()` | |
| `->jsonSerialize()` | |
| `::of()` | |
| `::parse()` | Accepts ISO dates (2026-10-03), the CII format 102 (20261003), date-time strings and DateTimeInterface instances. |
| `->toCarbon()` | |
| `::today()` | |
| `->toFormat102()` | Date in UN/CEFACT format 102 (CCYYMMDD). |
| `->toIsoString()` | |

### `__toString()`#

```
public function __toString(): string
```

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

### `addDays()`#

```
public function addDays(int $days): self
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$days` | `int` | |

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
</dl>

### `compareTo()`#

```
public function compareTo(self $other): int
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$other` | `self` | |

<dl><dt>Returns</dt>
<dd><code>int</code></dd>
</dl>

### `diffInDays()`#

```
public function diffInDays(self $other): int
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$other` | `self` | |

<dl><dt>Returns</dt>
<dd><code>int</code></dd>
</dl>

### `equals()`#

```
public function equals(self $other): bool
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$other` | `self` | |

<dl><dt>Returns</dt>
<dd><code>bool</code></dd>
</dl>

### `format()`#

```
public function format(string $format): string
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$format` | `string` | |

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

### `fromFormat102()`#

```
public static function fromFormat102(string $value): self
```

static

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

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string` | |

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Exceptions/InvalidArgumentException">InvalidArgumentException</a></code></dd>
</dl>

### `fromIsoDate()`#

```
public static function fromIsoDate(string $value): self
```

static

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.

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string` | |

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Exceptions/InvalidArgumentException">InvalidArgumentException</a></code></dd>
</dl>

### `isAfter()`#

```
public function isAfter(self $other): bool
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$other` | `self` | |

<dl><dt>Returns</dt>
<dd><code>bool</code></dd>
</dl>

### `isBefore()`#

```
public function isBefore(self $other): bool
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$other` | `self` | |

<dl><dt>Returns</dt>
<dd><code>bool</code></dd>
</dl>

### `jsonSerialize()`#

```
public function jsonSerialize(): string
```

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

### `of()`#

```
public static function of(int $year, int $month, int $day): self
```

static

| Parameter | Type | Description |
| --- | --- | --- |
| `$year` | `int` | |
| `$month` | `int` | |
| `$day` | `int` | |

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
</dl>

### `parse()`#

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

static

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

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

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `self\|DateTimeInterface\|string` | |
| `$timezone` | `DateTimeZone\|string\|null` = `null` | |

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
</dl>

### `toCarbon()`#

```
public function toCarbon(DateTimeZone|string|null $timezone = null): CarbonImmutable
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$timezone` | `DateTimeZone\|string\|null` = `null` | |

<dl><dt>Returns</dt>
<dd><code>Carbon\CarbonImmutable</code></dd>
</dl>

### `today()`#

```
public static function today(DateTimeZone|string|null $timezone = null): self
```

static

| Parameter | Type | Description |
| --- | --- | --- |
| `$timezone` | `DateTimeZone\|string\|null` = `null` | |

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
</dl>

### `toFormat102()`#

```
public function toFormat102(): string
```

Date in UN/CEFACT format 102 (CCYYMMDD).

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

### `toIsoString()`#

```
public function toIsoString(): string
```

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://quittio.dev/#website","@type":"WebSite","description":"E-Rechnungen für PHP und Laravel: ZUGFeRD, XRechnung und Peppol erstellen, prüfen, lesen und archivieren.","inLanguage":"de-DE","name":"Quittio","url":"https://quittio.dev/","publisher":{"@id":"https://quittio.dev/#identity"},"workTranslation":{"@id":"https://quittio.dev/en#website"}},{"@id":"https://quittio.dev/docs/api/Quittio/Core/Support/Date#webpage","@type":"WebPage","description":"Calendar date without time of day.","name":"Date – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Core/Support/Date","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/Support/Date"]}],"primaryImageOfPage":{"@id":"https://quittio.dev/#logo"}},{"@id":"https://quittio.dev/#identity","@type":"Organization","description":"Open-Source-Bibliothek für E-Rechnungen in PHP und Laravel (ZUGFeRD, XRechnung, Peppol) und Quittio Managed.","email":"kontakt@niklasforst.de","legalName":"Niklas Forst – Softwareentwicklung","name":"Quittio","url":"https://quittio.dev","founder":{"@type":"Person","name":"Niklas Forst","url":"https://quittio.dev/ueber"},"logo":{"@id":"https://quittio.dev/#logo"},"sameAs":["https://github.com/Quittio/quittio","https://packagist.org/packages/quittio/quittio"]},{"@id":"https://quittio.dev/#logo","@type":"ImageObject","caption":"Quittio","contentUrl":"https://quittio.dev/logo.png","inLanguage":"de-DE","url":"https://quittio.dev/logo.png"}]}
```