From 5c41f0bf8126c934e7eed774d1218ef1656cf164 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Wed, 22 Nov 2023 11:56:30 -0800 Subject: [PATCH] Clarify time.Format method --- content/en/methods/time/Format.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/content/en/methods/time/Format.md b/content/en/methods/time/Format.md index c784c14aa..fc3e2635c 100644 --- a/content/en/methods/time/Format.md +++ b/content/en/methods/time/Format.md @@ -1,6 +1,6 @@ --- 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: [] keywords: [] action: @@ -24,8 +24,9 @@ aliases: [/methods/time/format] ``` {{% 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 {{% /note %}} @@ -40,6 +41,12 @@ Use the `Format` method with any `time.Time` value, including the four predefine {{ .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 {{% include "functions/_common/time-layout-string.md" %}}