# 轻量时间格式化

轻量简单的日期格式化工具函数，毕竟很多时候我们并不想引入`moment`这个大块头。

可以引入`DateFormatter`组件作为`filter`, 参数为日期格式和时间及字符串格式。

\`\`\` vux height=50 components=Group filters=DateFormatter

&#x20;export default { data: { time1: new Date('2016/01/03 19:19:19'), time2: new Date('2016-01-03 09:09:09') } }  \`\`\`


---

# 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://vuxjs.gitbook.io/vux/shi-jian-zu-jian/qing-liang-shi-jian-ge-shi-hua.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.
