mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
New template action NowDate to get the time.Time of Now()
This commit is contained in:
parent
2e8a74ecff
commit
b62de4c521
1 changed files with 6 additions and 0 deletions
|
@ -54,6 +54,12 @@ func (c Context) Now(format string) string {
|
||||||
return time.Now().Format(format)
|
return time.Now().Format(format)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NowDate returns the current date/time that can be used
|
||||||
|
// in other time functions.
|
||||||
|
func (c Context) NowDate() time.Time {
|
||||||
|
return time.Now()
|
||||||
|
}
|
||||||
|
|
||||||
// Cookie gets the value of a cookie with name name.
|
// Cookie gets the value of a cookie with name name.
|
||||||
func (c Context) Cookie(name string) string {
|
func (c Context) Cookie(name string) string {
|
||||||
cookies := c.Req.Cookies()
|
cookies := c.Req.Cookies()
|
||||||
|
|
Loading…
Reference in a new issue