t := Date(year, Month(month), day, hour, min, sec, nsec, UTC)
// Look for local zone with the given offset.
// If that zone was in effect at the given time, use it.
- offset, _, ok := local.lookupName(zoneName, t.unixSec())
+ offset, ok := local.lookupName(zoneName, t.unixSec())
if ok {
t.addSec(-int64(offset))
t.setLoc(local)
// lookupName returns information about the time zone with
// the given name (such as "EST") at the given pseudo-Unix time
// (what the given time of day would be in UTC).
-func (l *Location) lookupName(name string, unix int64) (offset int, isDST bool, ok bool) {
+func (l *Location) lookupName(name string, unix int64) (offset int, ok bool) {
l = l.get()
// First try for a zone with the right name that was actually
for i := range l.zone {
zone := &l.zone[i]
if zone.name == name {
- nam, offset, isDST, _, _ := l.lookup(unix - int64(zone.offset))
+ nam, offset, _, _, _ := l.lookup(unix - int64(zone.offset))
if nam == zone.name {
- return offset, isDST, true
+ return offset, true
}
}
}
for i := range l.zone {
zone := &l.zone[i]
if zone.name == name {
- return zone.offset, zone.isDST, true
+ return zone.offset, true
}
}