This commit is contained in:
Bjørn Erik Pedersen 2025-01-23 09:47:46 +01:00
commit 43307b07f8
No known key found for this signature in database
384 changed files with 3305 additions and 3271 deletions

View file

@ -42,13 +42,12 @@ The list of valid time zones may be system dependent, but should include `UTC`,
The order of precedence for determining the time zone is:
1. The time zone offset in the date/time string
2. The time zone provided as the second argument to the `time.AsTime` function
3. The time zone specified in your site configuration
4. The `Etc/UTC` time zone
1. The time zone provided as the second argument to the `time.AsTime` function
1. The time zone specified in your site configuration
1. The `Etc/UTC` time zone
[IANA Time Zone database]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
[`time.Time`]: https://pkg.go.dev/time#Time
[`timeZone`]: https://gohugo.io/getting-started/configuration/#timezone
[`timeZone`]: /getting-started/configuration/#timezone
[functions]: /functions/time/
[methods]: /methods/time/

View file

@ -32,7 +32,6 @@ There are 86400 seconds in one day.
The time unit must be one of the following:
Duration|Valid time units
:--|:--
hours|`hour`, `h`

View file

@ -37,10 +37,10 @@ Examples of parsable string representations:
To override the default time zone, set the [`timeZone`] in your site configuration. The order of precedence for determining the time zone is:
1. The time zone offset in the date/time string
2. The time zone specified in your site configuration
3. The `Etc/UTC` time zone
1. The time zone specified in your site configuration
1. The `Etc/UTC` time zone
[`timeZone`]: https://gohugo.io/getting-started/configuration/#timezone
[`timeZone`]: /getting-started/configuration/#timezone
## Layout string

View file

@ -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/

View file

@ -17,7 +17,6 @@ aliases: [/functions/time.parseduration]
The `time.ParseDuration` function returns a time.Duration value that you can use with any of the `Duration` [methods].
A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as `300ms`, `-1.5h` or `2h45m`. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`.
This template: