mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit '346b60358dd8ec2ca228e6635bff9d7914b398b7'
This commit is contained in:
@@ -24,9 +24,8 @@ aliases: [/methods/time/format]
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
To [localize] the return value, use the [`time.Format`] function instead.
|
||||
To [localize](g) the return value, use the [`time.Format`] function instead.
|
||||
|
||||
[localize]: /getting-started/glossary/#localization
|
||||
[`time.Format`]: /functions/time/format/
|
||||
{{% /note %}}
|
||||
|
||||
|
@@ -14,7 +14,7 @@ action:
|
||||
|
||||
The rounding behavior for halfway values is to round up.
|
||||
|
||||
The `Round` method operates on TIME as an absolute duration since the [zero time]; it does not operate on the presentation form of the time. If DURATION is a multiple of one hour, `Round` may return a time with a non-zero minute, depending on the time zone.
|
||||
The `Round` method operates on TIME as an absolute duration since the [zero time](g); it does not operate on the presentation form of the time. If DURATION is a multiple of one hour, `Round` may return a time with a non-zero minute, depending on the time zone.
|
||||
|
||||
```go-html-template
|
||||
{{ $t := time.AsTime "2023-01-27T23:44:58-08:00" }}
|
||||
@@ -22,5 +22,3 @@ The `Round` method operates on TIME as an absolute duration since the [zero time
|
||||
|
||||
{{ ($t.Round $d).Format "2006-01-02T15:04:05-00:00" }} → 2023-01-28T00:00:00-00:00
|
||||
```
|
||||
|
||||
[zero time]: /getting-started/glossary/#zero-time
|
||||
|
@@ -12,7 +12,7 @@ action:
|
||||
signatures: [TIME.Truncate DURATION]
|
||||
---
|
||||
|
||||
The `Truncate` method operates on TIME as an absolute duration since the [zero time]; it does not operate on the presentation form of the time. If DURATION is a multiple of one hour, `Truncate` may return a time with a non-zero minute, depending on the time zone.
|
||||
The `Truncate` method operates on TIME as an absolute duration since the [zero time](g); it does not operate on the presentation form of the time. If DURATION is a multiple of one hour, `Truncate` may return a time with a non-zero minute, depending on the time zone.
|
||||
|
||||
```go-html-template
|
||||
{{ $t := time.AsTime "2023-01-27T23:44:58-08:00" }}
|
||||
@@ -20,5 +20,3 @@ The `Truncate` method operates on TIME as an absolute duration since the [zero t
|
||||
|
||||
{{ ($t.Truncate $d).Format "2006-01-02T15:04:05-00:00" }} → 2023-01-27T23:00:00-00:00
|
||||
```
|
||||
|
||||
[zero time]: /getting-started/glossary/#zero-time
|
||||
|
Reference in New Issue
Block a user