Files
liquid/filters/date.md
2016-04-02 18:46:32 -04:00

749 B

title
title
date

Converts a timestamp into another date format. The format for this syntax is the same as strftime.

Input

```liquid {% raw %} {{ article.published_at | date: "%a, %b %d, %y" }} {% endraw %} ```

Output

```text Fri, Jul 17, 15 ```

Input

```liquid {% raw %} {{ article.published_at | date: "%Y" }} {% endraw %} ```

Output

```text 2015 ```

date works on strings if they contain well-formatted dates:

Input

```liquid {% raw %} {{ "March 14, 2016" | date: "%b %d, %y" }} {% endraw %} ```

Output

```text {{ "March 14, 2016" | date: "%b %d, %y" }} ```