mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 04:32:37 +00:00
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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user