---
title: "date"

doc_type: static
doc_category: static
doc_version: v20260901
source_url:
  html: 'https://developer.shopline.com/docs/handlebars/helpers/format/date'
  md: 'https://developer.shopline.com/docs/handlebars/helpers/format/date.md'
---
# date

Converts a timestamp into another date format.

Output formats can be referenced from the [Ruby documentation](https://ruby-doc.org/core-3.1.1/Time.html#method-i-strftime).

## Parameters

- `time` `{String}`: The timestamp. This parameter is required.
- `format` `{String}`: The date format. This parameter is optional.
- `hash.format` `{String}`: The date format. This parameter is optional.
- `returns` `{String}`: The formatted date string.

## Usage

```handlebars
{{date string string}}
```

## Example

<Example data={['article.created_at']}>
```handlebars
{{ date article.created_at '%B %d, %Y' }}
```
</Example>

### Current Date

The date helper can be applied to the keywords 'today' and 'now' to output the current timestamp.

:::note{title='Note'}
The timestamp corresponds to the time of the most recent Handlebars rendering. Consequently, it may not refresh with every page view due to context and caching considerations.
:::

<Example>
  ```handlebars
  {{ date 'now' '%B %d, %Y' }}
  ```
</Example>

### Format

```handlebars
{{date string string}}
{{date string format=string}}
```

Specify the date format recognizable by the locale. You can use the following formats:

- `abbreviated_date`
- `basic`
- `date`
- `date_at_time`
- `default`
- `on_date`

<Example data={['article.created_at']}>
```handlebars
{{ date article.created_at 'abbreviated_date' }}
```
</Example>