From aa6e67d7b2996b3b3c4e93ad6608c5753f03f03b Mon Sep 17 00:00:00 2001 From: ale Date: Sun, 28 Jun 2015 21:51:11 +0100 Subject: fix timestamp format The WARC-Date fields now are UTC times in proper ISO-8601 format. This makes pywb and other tools happy. --- warc/warc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/warc/warc.go b/warc/warc.go index 85e53f7..0739fb9 100644 --- a/warc/warc.go +++ b/warc/warc.go @@ -13,7 +13,7 @@ import ( ) var ( - warcTimeFmt = time.RFC3339 + warcTimeFmt = "2006-01-02T15:04:05Z" warcVersion = "WARC/1.0" warcContentTypes = map[string]string{ "warcinfo": "application/warc-fields", @@ -60,7 +60,7 @@ func (h Header) Encode(w io.Writer) { func NewHeader() Header { h := make(Header) h.Set("WARC-Record-ID", fmt.Sprintf("<%s>", uuid.NewUUID().URN())) - h.Set("WARC-Date", time.Now().Format(warcTimeFmt)) + h.Set("WARC-Date", time.Now().UTC().Format(warcTimeFmt)) h.Set("Content-Type", "application/octet-stream") return h } -- cgit v1.2.3-54-g00ecf