Skip to content

Commit

Permalink
chore: remove unused method hasTimezone
Browse files Browse the repository at this point in the history
  • Loading branch information
iagapie committed Sep 6, 2024
1 parent 7f94137 commit 2430b5f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions time.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ type timeFormat struct {
typ timeFormatType
}

func (f timeFormat) hasTimezone() bool {
// We don't include the formats with only named timezones, see
// https://github.com/golang/go/issues/19694#issuecomment-289103522
return f.typ >= timeFormatNumericTimezone && f.typ <= timeFormatNumericAndNamedTimezone
}

var (
timeFormats = []timeFormat{
// Keep common formats at the top.
Expand Down Expand Up @@ -61,8 +55,8 @@ func toTime(s string) (d time.Time, e error) {
if d, e = time.Parse(format.format, s); e == nil {
if format.typ <= timeFormatNamedTimezone {
year, month, day := d.Date()
hour, min, sec := d.Clock()
d = time.Date(year, month, day, hour, min, sec, d.Nanosecond(), time.UTC)
hour, m, sec := d.Clock()
d = time.Date(year, month, day, hour, m, sec, d.Nanosecond(), time.UTC)
}
return
}
Expand Down

0 comments on commit 2430b5f

Please sign in to comment.