|
|
@@ -99,14 +99,20 @@ func (result Result) ColumnValueStringAsTime(columnName string) time.Time {
|
|
|
return time.Time{}
|
|
|
}
|
|
|
|
|
|
- var layout string
|
|
|
-
|
|
|
- if strings.HasSuffix(value, ".000000+08:00") {
|
|
|
- layout = resultTimeMicroFormat
|
|
|
- } else if strings.HasSuffix(value, ".000+08:00") {
|
|
|
- layout = resultTimeMilliFormat
|
|
|
- } else {
|
|
|
- layout = resultTimeSecFormat
|
|
|
+ layout := resultTimeSecFormat
|
|
|
+
|
|
|
+ timeZoneIndex := strings.LastIndex(value, "+08:")
|
|
|
+ if timeZoneIndex != -1 {
|
|
|
+ value = value[:timeZoneIndex]
|
|
|
+
|
|
|
+ afterSecondIndex := strings.LastIndex(value, ".")
|
|
|
+ if afterSecondIndex != -1 {
|
|
|
+ if len(value)-afterSecondIndex-1 == 6 {
|
|
|
+ layout = resultTimeMicroFormat
|
|
|
+ } else if len(value)-afterSecondIndex-1 == 3 {
|
|
|
+ layout = resultTimeMilliFormat
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
t, err := time.ParseInLocation(layout, value, time.Local)
|