fix String2Time
This commit is contained in:
parent
50ef83d456
commit
eb076f4b94
|
@ -69,13 +69,6 @@ func String2Time(s string, originalLocation *time.Location, convertedLocation *t
|
||||||
}
|
}
|
||||||
dt = dt.In(convertedLocation)
|
dt = dt.In(convertedLocation)
|
||||||
return &dt, nil
|
return &dt, nil
|
||||||
} else if len(s) == 21 && s[10] == 'T' {
|
|
||||||
dt, err := time.ParseInLocation("2006-01-02T15:04:05", s[:19], originalLocation)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
dt = dt.In(convertedLocation)
|
|
||||||
return &dt, nil
|
|
||||||
} else if len(s) == 10 && s[4] == '-' {
|
} else if len(s) == 10 && s[4] == '-' {
|
||||||
if s == "0000-00-00" || s == "0001-01-01" {
|
if s == "0000-00-00" || s == "0001-01-01" {
|
||||||
return &time.Time{}, nil
|
return &time.Time{}, nil
|
||||||
|
|
Loading…
Reference in New Issue