# date\_str

Converts a string timestamp into another date format returned as a string. The format for this syntax is the same as [`strftime`](http://strftime.net/). `date_str` is nearly the same as piping a string to [str\_to\_date](/impulse-user-manual/content-manipulators-motators/liquid-field/filters/str_to_date.md) then piping the value to [date](/impulse-user-manual/content-manipulators-motators/liquid-field/filters/date.md).

Input

```
{{ article.published_at | date_str: "%a, %b %d, %y" }}
```

Output

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

Input

```
{{ article.published_at | date_str: "%Y" }}
```

Output

```
2015
```

`date_str` works on unix timestamps.

Input

```
{{'980989200' | date_str: '%Y-%m-%d %H:%M' }}
```

Output

```
2001-02-01 01:00
```

Input

```
{{'1706201489' | date_str: '%Y-%m-%d %H:%M' }}
```

Output

```
2024-01-25 16:51
```

To get the current time, pass the special word `"now"` (or `"today"`) to `date`.

Input

```
This page was last updated at {{ "now" | date: "%Y-%m-%d %H:%M" }}.
```

Output

```
This page was last updated at 2023-07-07 14:07.
```

Note that the value will be the current time of when the page was last generated from the template, not when the page is presented to a user if caching or static site generation is involved.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://motivlabs.gitbook.io/impulse-user-manual/content-manipulators-motators/liquid-field/filters/date_str.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
