diff options
author | ale <ale@incal.net> | 2015-06-28 21:51:11 +0100 |
---|---|---|
committer | ale <ale@incal.net> | 2015-06-28 21:51:11 +0100 |
commit | aa6e67d7b2996b3b3c4e93ad6608c5753f03f03b (patch) | |
tree | bee4fd3f0e6ce185eafbb22443c2bbf1806a34da /warc | |
parent | 3af8c9a229abb85ad75bef1c3526e44435befd02 (diff) | |
download | crawl-aa6e67d7b2996b3b3c4e93ad6608c5753f03f03b.tar.gz crawl-aa6e67d7b2996b3b3c4e93ad6608c5753f03f03b.zip |
fix timestamp format
The WARC-Date fields now are UTC times in proper ISO-8601 format. This
makes pywb and other tools happy.
Diffstat (limited to 'warc')
-rw-r--r-- | warc/warc.go | 4 |
1 files 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 } |