@marcel91200 / caddy Mirror · read-only / commits / 1b1e625c
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

core: Unix ns and Unix ms time placeholders (#4280)

Rainer Borene committed Aug 16, 2021 at 18:06 UTC 1b1e625c201bdc2570dded6164e212f3abda902c
1 file changed +4
replacer.go
+4
@@ -301,6 +301,10 @@ func globalDefaultReplacements(key string) (interface{}, bool) {
301 return nowFunc().Format("02/Jan/2006:15:04:05 -0700"), true
302 case "time.now.year":
303 return strconv.Itoa(nowFunc().Year()), true
304 + case "time.now.unix":
305 + return strconv.FormatInt(nowFunc().Unix(), 10), true
306 + case "time.now.unix_ms":
307 + return strconv.FormatInt(nowFunc().UnixNano()/int64(time.Millisecond), 10), true
308 }
309
310 return nil, false