Merge pull request #5416 from smarterclayton/use_utc_serialized_and_local_otherwise

Use UTC when marshalling times and Local when unmarshalling
This commit is contained in:
Satnam Singh
2015-03-20 08:32:26 -07:00
2 changed files with 18 additions and 13 deletions

View File

@@ -86,7 +86,7 @@ func (t *Time) UnmarshalJSON(b []byte) error {
return err
}
t.Time = pt
t.Time = pt.Local()
return nil
}
@@ -97,7 +97,7 @@ func (t Time) MarshalJSON() ([]byte, error) {
return []byte("null"), nil
}
return json.Marshal(t.Format(time.RFC3339))
return json.Marshal(t.UTC().Format(time.RFC3339))
}
// Fuzz satisfies fuzz.Interface.