github.com/rabbouni145/gg@v0.47.1/docs/content/en/functions/now.md (about) 1 --- 2 title: now 3 linktitle: now 4 description: Returns the current local time 5 godocref: https://godoc.org/time#Time 6 date: 2017-02-01 7 publishdate: 2017-02-01 8 lastmod: 2017-04-30 9 categories: [functions] 10 menu: 11 docs: 12 parent: "functions" 13 keywords: [dates,time] 14 signature: ["now"] 15 workson: [] 16 hugoversion: 17 relatedfuncs: [Unix,dateFormat] 18 deprecated: false 19 aliases: [] 20 --- 21 22 See [`time.Time`](https://godoc.org/time#Time). 23 24 For example, building your site on June 24, 2017, with the following templating: 25 26 ``` 27 <div> 28 <small>© {{ now.Format "2006"}}</small> 29 </div> 30 ``` 31 32 would produce the following: 33 34 ``` 35 <div> 36 <small>© 2017</small> 37 </div> 38 ``` 39 40 The above example uses the [`.Format` function](/functions/format), which page includes a full listing of date formatting using Go's layout string. 41 42 {{% note %}} 43 Older Hugo themes may still be using the obsolete Page’s `.Now` (uppercase with leading dot), which causes build error that looks like the following: 44 45 ERROR ... Error while rendering "..." in "...": ... 46 executing "..." at <.Now.Format>: 47 can't evaluate field Now in type *hugolib.PageOutput 48 49 Be sure to use `now` (lowercase with _**no**_ leading dot) in your templating. 50 {{% /note %}}