diff options
-rw-r--r-- | crtsh-pem2html.go | 11 | ||||
-rw-r--r-- | tls-pem2html.go | 11 |
2 files changed, 20 insertions, 2 deletions
diff --git a/crtsh-pem2html.go b/crtsh-pem2html.go index 957e23a..63249c3 100644 --- a/crtsh-pem2html.go +++ b/crtsh-pem2html.go @@ -104,7 +104,16 @@ var tmpl = template.Must(template.New("pem2html"). </html> `)) -var now = time.Now() +func getNow() time.Time { + stat, err := os.Stdin.Stat() + if err == nil { + return stat.ModTime() + } else { + return time.Now() + } +} + +var now = getNow() type interpolation struct { ta, tb time.Time diff --git a/tls-pem2html.go b/tls-pem2html.go index f38ab5f..50d5104 100644 --- a/tls-pem2html.go +++ b/tls-pem2html.go @@ -105,7 +105,16 @@ var tmpl = template.Must(template.New("pem2html"). </html> `)) -var now = time.Now() +func getNow() time.Time { + stat, err := os.Stdin.Stat() + if err == nil { + return stat.ModTime() + } else { + return time.Now() + } +} + +var now = getNow() type interpolation struct { ta, tb time.Time |