Fix time
This commit is contained in:
parent
e6a55d83b4
commit
dcf63e09ca
|
@ -25,6 +25,13 @@ 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) == 25 && s[10] == 'T' && s[19] == '+' && s[22] == ':' {
|
||||||
|
dt, err := time.Parse("2006-01-02T15:04:05+07:00", s)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
dt = dt.In(convertedLocation)
|
||||||
|
return &dt, nil
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("unsupported convertion from %s to time", s)
|
return nil, fmt.Errorf("unsupported convertion from %s to time", s)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue