aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/html/html.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-06-30 15:16:47 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-07-09 19:40:12 +0200
commit894db56cb21049ff801b30b3f294854d6da099de (patch)
treedba906dde0ff022015714855ae165428bd351414 /pkg/html/html.go
parent66bbaf2d5976862ae98e219b389ae2042005639d (diff)
pkg/html: add function to format JS time
Diffstat (limited to 'pkg/html/html.go')
-rw-r--r--pkg/html/html.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/html/html.go b/pkg/html/html.go
index 1199c5ab0..4bd9621d1 100644
--- a/pkg/html/html.go
+++ b/pkg/html/html.go
@@ -42,6 +42,7 @@ var Funcs = template.FuncMap{
"formatTime": FormatTime,
"formatDate": FormatDate,
"formatKernelTime": formatKernelTime,
+ "formatJSTime": formatJSTime,
"formatClock": formatClock,
"formatDuration": formatDuration,
"formatLateness": formatLateness,
@@ -98,6 +99,10 @@ func formatKernelTime(t time.Time) string {
return t.Format("Mon Jan 2 15:04:05 2006 -0700")
}
+func formatJSTime(t time.Time) string {
+ return t.Format("2006-01-02T15:04:05") // ISO 8601 without time zone
+}
+
func formatClock(t time.Time) string {
if t.IsZero() {
return ""