mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 22:16:02 +00:00
Clarify time.Format method
This commit is contained in:
1 parent
f7bd43ae1a
commit
5c41f0bf81
1 file changed
+9
-2
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: Format
|
title: Format
|
||||||
description: Returns a formatted time.Time value.
|
description: Returns a textual representation of the time.Time value formatted according to the layout string.
|
||||||
categories: []
|
categories: []
|
||||||
keywords: []
|
keywords: []
|
||||||
action:
|
action:
|
||||||
@@ -24,8 +24,9 @@ aliases: [/methods/time/format]
|
|||||||
```
|
```
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
To return a formatted and localized `time.Time` value, use the [`time.Format`] function instead.
|
To [localize] the return value, use the [`time.Format`] function instead.
|
||||||
|
|
||||||
|
[localize]: /getting-started/glossary/#localization
|
||||||
[`time.Format`]: /functions/time/format
|
[`time.Format`]: /functions/time/format
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
@@ -40,6 +41,12 @@ Use the `Format` method with any `time.Time` value, including the four predefine
|
|||||||
{{ .Lastmod.Format $format }}
|
{{ .Lastmod.Format $format }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{{% note %}}
|
||||||
|
Use the [`time.Format`] function to format string representations of dates, and to format raw TOML dates that exclude time and time zone offset.
|
||||||
|
|
||||||
|
[`time.Format`]: /functions/time/format
|
||||||
|
{{% /note %}}
|
||||||
|
|
||||||
## Layout string
|
## Layout string
|
||||||
|
|
||||||
{{% include "functions/_common/time-layout-string.md" %}}
|
{{% include "functions/_common/time-layout-string.md" %}}
|
||||||
|
|||||||
Reference in new issue
Block a user