aboutsummaryrefslogtreecommitdiffstats
path: root/objects.go
diff options
context:
space:
mode:
authorAlex Guerrieri <alex@tyba.com>2015-11-23 18:04:12 +0100
committerAlex Guerrieri <alex@tyba.com>2015-11-23 18:04:12 +0100
commit4f537be5c121129961ddaf74af004a9c2c00d973 (patch)
tree33b5e734d8c38cb93429d3328a07e0280b5b4f8b /objects.go
parentcaab43e7f4ee10a15b2af826485b688473b34356 (diff)
downloadgo-git-4f537be5c121129961ddaf74af004a9c2c00d973.tar.gz
Timezone fixes
Diffstat (limited to 'objects.go')
-rw-r--r--objects.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/objects.go b/objects.go
index 351a022..9397bc8 100644
--- a/objects.go
+++ b/objects.go
@@ -76,7 +76,15 @@ func (s *Signature) Decode(b []byte) {
if c == ' ' || end {
t, err := strconv.ParseInt(string(b[from:i]), 10, 64)
if err == nil {
- s.When = time.Unix(t, 0)
+ loc := time.UTC
+ ts := time.Unix(t, 0)
+ if len(b[i:]) >= 6 {
+ tl, err := time.Parse(" -0700", string(b[i:i+6]))
+ if err == nil {
+ loc = tl.Location()
+ }
+ }
+ s.When = ts.In(loc)
}
end = true
}