---
title: "Format.date ViewHelper <f:format.date>"
manual: "Fluid ViewHelper Reference"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-format-date@13.4"
source: "Global/Format/Date.rst"
rendered: "2026-09-27T06:57:26+00:00"
---

# Format.date ViewHelper `<f:format.date>` {#typo3-fluid-format-date}

ViewHelper to format an object implementing `\DateTimeInterface` into human-readable output.

Go to the source code of this ViewHelper: [Format\\DateViewHelper.php (GitHub)](https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Format/DateViewHelper.php).

**Table of contents**

-   [Examples](https://docs.typo3.org/permalink/t3viewhelper:examples@13.4)
-   [Arguments of the <f:format.date> ViewHelper](https://docs.typo3.org/permalink/t3viewhelper:arguments-of-the-f-format-date-viewhelper@13.4)

## Examples {#typo3-fluid-format-date-example}

### Defaults {#typo3-fluid-format-date-defaults}

**packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html**

```html
<f:format.date>{dateObject}</f:format.date>
```

**Output**

```text
1980-12-13
```

Depending on the current date.

### Custom date format {#typo3-fluid-format-date-custom-date-format}

**packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html**

```html
<f:format.date format="H:i">{dateObject}</f:format.date>
```

**Output**

```text
01:23
```

Depending on the current time.

### Relative date with given time {#typo3-fluid-format-date-relative-date-with-given-time}

**packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html**

```html
<f:format.date format="Y" base="{dateObject}">-1 year</f:format.date>
```

**Output**

```text
2016
```

Assuming dateObject is in 2017.

### strtotime string {#typo3-fluid-format-date-strtotime-string}

**packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html**

```html
<f:format.date format="d.m.Y - H:i:s">+1 week 2 days 4 hours 2 seconds</f:format.date>
```

**Output**

```text
13.12.1980 - 21:03:42
```

Depending on the current time, see [https://www.php.net/manual/function.strtotime.php](https://www.php.net/manual/function.strtotime.php).

### Localized dates using strftime date format {#typo3-fluid-format-date-localized-dates-using-strftime-date-format}

**packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html**

```html
<f:format.date format="%d. %B %Y">{dateObject}</f:format.date>
```

**Output**

```text
13. Dezember 1980
```

Depending on the current date and defined locale. In the example you see the 1980-12-13 in a german locale.

### Localized dates using ICU-based date and time formatting {#typo3-fluid-format-date-localized-dates-using-icu-based-date-and-time-formatting}

**packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html**

```html
<f:format.date pattern="dd. MMMM yyyy" locale="de-DE">{dateObject}</f:format.date>
```

**Output**

```text
13. Dezember 1980
```

Depending on the current date. In the example you see the 1980-12-13 in a german locale.

### Localized dates using default formatting patterns {#typo3-fluid-format-date-localized-dates-using-default-formatting-patterns}

**packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html**

```html
<f:format.date pattern="FULL" locale="fr-FR">{dateObject}</f:format.date>
```

**Output**

```text
jeudi 9 mars 2023 à 21:40:49 temps universel coordonné
```

Depending on the current date and operating system setting. In the example you see the 2023-03-09 in a french locale.

### Inline notation {#typo3-fluid-format-date-inline-notation}

**packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html**

```html
{f:format.date(date: dateObject)}
```

**Output**

```text
1980-12-13
```

Depending on the value of `{dateObject}`.

### Inline notation (2nd variant) {#typo3-fluid-format-date-inline-notation-2nd-variant}

**packages/my_extension/Resources/Private/Templates/Content/Text.fluid.html**

```html
{dateObject -> f:format.date()}
```

**Output**

```text
1980-12-13
```

Depending on the value of `{dateObject}`.

## Arguments of the `<f:format.date>` ViewHelper {#typo3-fluid-format-date-arguments}

-   **base**

    -   *Type:* mixed

    A base time (an object implementing DateTimeInterface or a string) used if $date is a relative date specification. Defaults to current time.

-   **date**

    -   *Type:* mixed

    Either an object implementing DateTimeInterface or a string that is accepted by DateTime constructor

-   **format**

    -   *Type:* string
    -   *Default:* ''

    Format String which is taken to format the Date/Time

-   **locale**

    -   *Type:* string

    A locale format such as "nl-NL" to format the date in a specific locale, if none given, uses the current locale of the current request. Only works when pattern argument is given

-   **pattern**

    -   *Type:* string

    Format date based on unicode ICO format pattern given see https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax. If both "pattern" and "format" arguments are given, pattern will be used.
