mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
docs: Add doc for time template func
This commit is contained in:
parent
f2faae0805
commit
b33bfd40be
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue