mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
implement zoneinfo reader
R=r DELTA=348 (338 added, 0 deleted, 10 changed) OCL=15648 CL=15660
This commit is contained in:
parent
3c17ee69d9
commit
c14924bcc8
3 changed files with 344 additions and 8 deletions
|
|
@ -152,8 +152,8 @@ export func UTC() (t *Time, err *os.Error) {
|
|||
|
||||
// TODO: Should this return an error?
|
||||
export func SecondsToLocalTime(sec int64) *Time {
|
||||
zone, offset, ok := time.LookupTimezone(sec)
|
||||
if !ok {
|
||||
zone, offset, err := time.LookupTimezone(sec)
|
||||
if err != nil {
|
||||
return SecondsToUTC(sec)
|
||||
}
|
||||
t := SecondsToUTC(sec+int64(offset));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue