Clarify time.Format method

This commit is contained in:
Joe Mooring authored and GitHub committed 2023-11-22 11:56:30 -08:00
1 parent f7bd43ae1a
commit 5c41f0bf81
1 file changed
+9 -2
+9 -2
View File
@@ -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" %}}