mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
Merge commit 'f96384a3b596f9bc0a3a035970b09b2c601f0ccb'
This commit is contained in:
@@ -1,36 +1,28 @@
|
||||
---
|
||||
title: now
|
||||
linktitle: now
|
||||
description: Returns the current local time
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-04-30
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
parent: functions
|
||||
keywords: [dates,time]
|
||||
signature: ["now"]
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: [Unix,dateFormat]
|
||||
deprecated: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
See [`time.Time`](https://godoc.org/time#Time).
|
||||
|
||||
For example, building your site on June 24, 2017, with the following templating:
|
||||
|
||||
```
|
||||
```go-html-template
|
||||
<div>
|
||||
<small>© {{ now.Format "2006"}}</small>
|
||||
<small>© {{ now.Format "2006" }}</small>
|
||||
</div>
|
||||
```
|
||||
|
||||
would produce the following:
|
||||
|
||||
```
|
||||
```html
|
||||
<div>
|
||||
<small>© 2017</small>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user