<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Time functions on Hugo</title><link>https://v0-122-0--gohugoio.netlify.app/functions/time/</link><description>Recent content in Time functions on Hugo</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://v0-122-0--gohugoio.netlify.app/functions/time/index.xml" rel="self" type="application/rss+xml"/><item><title>time.AsTime</title><link>https://v0-122-0--gohugoio.netlify.app/functions/time/astime/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-122-0--gohugoio.netlify.app/functions/time/astime/</guid><description>Overview Hugo provides functions and methods to format, localize, parse, compare, and manipulate date/time values. Before you can do any of these with string representations of date/time values, you must first convert them to time.Time values using the time.AsTime function.
{{ $t := &amp;#34;2023-10-15T14:20:28-07:00&amp;#34; }} {{ time.AsTime $t }} → 2023-10-15 14:20:28 -0700 PDT (time.Time) Parsable strings As shown above, the first argument must be a parsable string representation of a date/time value.</description></item><item><title>time.Duration</title><link>https://v0-122-0--gohugoio.netlify.app/functions/time/duration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-122-0--gohugoio.netlify.app/functions/time/duration/</guid><description>The time.Duration function returns a time.Duration value that you can use with any of the Duration methods.
This template:
{{ $duration := time.Duration &amp;#34;hour&amp;#34; 24 }} {{ printf &amp;#34;There are %.0f seconds in one day.&amp;#34; $duration.Seconds }} Is rendered to:
There are 86400 seconds in one day. The time unit must be one of the following:
Duration Valid time units hours hour, h minutes minute, m seconds second, s milliseconds millisecond, ms microseconds microsecond, us, µs nanoseconds nanosecond, ns</description></item><item><title>time.Format</title><link>https://v0-122-0--gohugoio.netlify.app/functions/time/format/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-122-0--gohugoio.netlify.app/functions/time/format/</guid><description>Use the time.Format function with time.Time values:
{{ $t := time.AsTime &amp;#34;2023-02-27T23:44:58-08:00&amp;#34; }} {{ time.Format &amp;#34;2 Jan 2006&amp;#34; $t }} → 27 Feb 2023 Or use time.Format with a parsable string representation of a date/time value:
{{ $t := &amp;#34;27 Feb 2023&amp;#34; }} {{ time.Format &amp;#34;January 2, 2006&amp;#34; $t }} → February 27, 2023 Examples of parsable string representations:
String representation Time zone 2023-10-15T14:20:28-07:00 America/Los_Angeles 2023-10-15T13:18:50-0700 America/Los_Angeles 2023-10-15T13:18:50Z Etc/UTC 2023-10-15T13:18:50 Etc/UTC 2023-10-15 Etc/UTC 15 Oct 2023 Etc/UTC The last four examples are not fully qualified.</description></item><item><title>time.Now</title><link>https://v0-122-0--gohugoio.netlify.app/functions/time/now/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-122-0--gohugoio.netlify.app/functions/time/now/</guid><description>For example, when building a site on October 15, 2023 in the America/Los_Angeles time zone:
{{ time.Now }} 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:
{{ time.Now | time.Format &amp;#34;Jan 2006&amp;#34; }} → Oct 2023 The time.Now function returns a time.Time value, so you can chain any of the time methods to the resulting value.</description></item><item><title>time.ParseDuration</title><link>https://v0-122-0--gohugoio.netlify.app/functions/time/parseduration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://v0-122-0--gohugoio.netlify.app/functions/time/parseduration/</guid><description>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:
{{ $duration := time.ParseDuration &amp;#34;24h&amp;#34; }} {{ printf &amp;#34;There are %.0f seconds in one day.</description></item></channel></rss>