From 67076e5838c8749f1882e29f179f81df69738b65 Mon Sep 17 00:00:00 2001 From: Ryan Watters Date: Sat, 1 Apr 2017 10:38:27 -0500 Subject: [PATCH] Add example to "now" function Closes rdwatters/hugo-docs-concept#63 --- content/functions/now.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/content/functions/now.md b/content/functions/now.md index 2ce3ba5bb..9ef12d205 100644 --- a/content/functions/now.md +++ b/content/functions/now.md @@ -19,3 +19,25 @@ needsexamples: true --- `now` returns the current local time as a [`time.Time`](https://godoc.org/time#Time). + +For example, building your site on June 24, 2017 with the following templating: + +```html + +``` + +Which will produce the following: + +```html + +``` + +The above example also uses the [`.Format` function](/functions/format), which page includes a full listing of date formatting using Golang's layout string. + +{{% note %}} +Older Hugo themes may use the deprecated `.Now` (uppercase). Be sure to use the lowercase `.now` in your templating. +{{% /note %}}