docs: Add doc for time template func

This commit is contained in:
Wade Fitzpatrick 2016-08-08 11:38:18 +10:00 committed by digitalcraftsman
parent f2faae0805
commit b33bfd40be

View file

@ -741,6 +741,16 @@ This can be useful if you want to use Gravatar for generating a unique avatar:
```
## Times
### time
`time` converts a timestamp string into a [`time.Time`](https://godoc.org/time#Time) structure so you can access its fields. E.g.
* `{{ time "2016-05-28" }}` → "2016-05-28T00:00:00Z"
* `{{ (time "2016-05-28").YearDay }}` → 149
* `{{ mul 1000 (time "2016-05-28T10:30:00.00+10:00").Unix }}` → 1464395400000 (Unix time in milliseconds)
## URLs