> ## Content Index
> Fetch the complete content index at: https://getpublii.com/dev/llms.txt
> Use this file to discover other available public pages before exploring further.

# {{date}} helper

- URL: https://getpublii.com/dev/date-helper/
- Published: 2017-08-04T22:01:09.495Z
- Updated: 2024-03-04T07:50:10.163Z
- Description: Generate the date in the specified format. The date format must be compatible with the moment().js library. This flexibility now extends to specifying the language…
- Author: Tomasz Dziuda
- Tags: Helpers

Generate the date in the specified format.

The date format must be compatible with the [moment().js](http://momentjs.com/) library. This flexibility now extends to specifying the language for the output, accommodating scenarios where you need to format dates in a language different from the main language of your site.

Syntax:

```handlebars
{{date timestamp "format" [omitTz] "locale"}}
```

The **format** is optional. If not specified, then the **MMM Do YYYY** format is used. The newly added fourth parameter, **locale**, specifies the language code (e.g., 'en' for English, 'fr' for French) for the date output.

Example:

```handlebars
{{date createdAt 'YYYY-MM-DDTHH:mm' false 'en'}}
```

In the above example, the date is formatted according to the specified format and language code, allowing for displaying dates in English on a site primarily in another language, such as French. This is particularly useful for content like RSS feeds, where standardized date formatting in a specific language might be required regardless of the site's primary language setting.
