mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +00:00
Merge faf48da321 into dddbaa4bf3
This commit is contained in:
commit
c6c8cca97b
1 changed files with 6 additions and 1 deletions
|
|
@ -230,7 +230,12 @@ func toISO8601(t time.Time) string {
|
||||||
if name == "UTC" {
|
if name == "UTC" {
|
||||||
tz = "Z"
|
tz = "Z"
|
||||||
} else {
|
} else {
|
||||||
tz = fmt.Sprintf("%+03d00", offset/3600)
|
hours := offset / 3600
|
||||||
|
minutes := (offset % 3600) / 60
|
||||||
|
if minutes < 0 {
|
||||||
|
minutes = -minutes
|
||||||
|
}
|
||||||
|
tz = fmt.Sprintf("%+03d%02d", hours, minutes)
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%04d-%02d-%02dT%02d-%02d-%02d.%09d%s",
|
return fmt.Sprintf("%04d-%02d-%02dT%02d-%02d-%02d.%09d%s",
|
||||||
t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), tz)
|
t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), tz)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue