Skip to content

Commit

Permalink
docs: Add doc for time template func
Browse files Browse the repository at this point in the history
  • Loading branch information
waddles authored and digitalcraftsman committed Aug 8, 2016
1 parent f2faae0 commit b33bfd4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/content/templates/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b33bfd4

Please sign in to comment.