mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Merge commit '346b60358dd8ec2ca228e6635bff9d7914b398b7'
This commit is contained in:
@@ -27,7 +27,7 @@ This produces a `time.Time` value, with a string representation such as:
|
||||
2023-10-15 12:59:28.337140706 -0700 PDT m=+0.041752605
|
||||
```
|
||||
|
||||
To format and [localize] the value, pass it through the [`time.Format`] function:
|
||||
To format and [localize](g) the value, pass it through the [`time.Format`] function:
|
||||
|
||||
```go-html-template
|
||||
{{ time.Now | time.Format "Jan 2006" }} → Oct 2023
|
||||
@@ -35,7 +35,6 @@ To format and [localize] the value, pass it through the [`time.Format`] function
|
||||
|
||||
The `time.Now` function returns a `time.Time` value, so you can chain any of the [time methods] to the resulting value. For example:
|
||||
|
||||
|
||||
```go-html-template
|
||||
{{ time.Now.Year }} → 2023 (int)
|
||||
{{ time.Now.Weekday.String }} → Sunday
|
||||
@@ -44,5 +43,4 @@ The `time.Now` function returns a `time.Time` value, so you can chain any of the
|
||||
```
|
||||
|
||||
[`time.Format`]: /functions/time/format/
|
||||
[localize]: /getting-started/glossary/#localization
|
||||
[time methods]: /methods/time/
|
||||
|
Reference in New Issue
Block a user