0
Fork 0
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:
Matthew Holt 2015-08-05 08:27:13 -06:00
parent 2e8a74ecff
commit b62de4c521

View file

@ -54,6 +54,12 @@ func (c Context) Now(format string) string {
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.
func (c Context) Cookie(name string) string {
cookies := c.Req.Cookies()