mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 22:16:02 +00:00
docs: Add doc for time template func
This commit is contained in:
1 parent
3c6fae17ec
commit
e8ebe0452b
1 file changed
+10
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user