|
@@ -150,7 +150,7 @@ func (this *CoalMineDataController) JsmHistory() {
|
|
|
var item models.BaseFromCoalmineJsmIndex
|
|
|
if k == 0 {
|
|
|
text := cell.Value
|
|
|
- parsedTime, err := time.Parse("01-02-06", text)
|
|
|
+ parsedTime, err := time.ParseInLocation("01-02-06", text, time.Local)
|
|
|
if err != nil {
|
|
|
fmt.Println("解析时间字符串出错:", err)
|
|
|
return
|
|
@@ -386,9 +386,9 @@ func (this *CoalMineDataController) CoastalHistory() {
|
|
|
if len(text) < 6 {
|
|
|
dataTime = ExcelDateToDate(text).Format(utils.FormatDate)
|
|
|
} else {
|
|
|
- parsedTime, err := time.Parse("01-02-06", text)
|
|
|
+ parsedTime, err := time.ParseInLocation("01-02-06", text, time.Local)
|
|
|
if err != nil {
|
|
|
- parsedTime, err = time.Parse("2006/01/02", text)
|
|
|
+ parsedTime, err = time.ParseInLocation("2006/01/02", text, time.Local)
|
|
|
if err != nil {
|
|
|
fmt.Println("解析时间字符串出错:", err)
|
|
|
return
|
|
@@ -613,9 +613,9 @@ func (this *CoalMineDataController) InlandHistory() {
|
|
|
if len(text) < 6 {
|
|
|
dataTime = ExcelDateToDate(text).Format(utils.FormatDate)
|
|
|
} else {
|
|
|
- parsedTime, err := time.Parse("01-02-06", text)
|
|
|
+ parsedTime, err := time.ParseInLocation("01-02-06", text, time.Local)
|
|
|
if err != nil {
|
|
|
- parsedTime, err = time.Parse("2006/01/02", text)
|
|
|
+ parsedTime, err = time.ParseInLocation("2006/01/02", text, time.Local)
|
|
|
if err != nil {
|
|
|
fmt.Println("解析时间字符串出错:", err)
|
|
|
return
|
|
@@ -1234,9 +1234,9 @@ func (this *CoalMineDataController) Coastal() {
|
|
|
if len(text) < 6 {
|
|
|
dataTime = ExcelDateToDate(text).Format(utils.FormatDate)
|
|
|
} else {
|
|
|
- parsedTime, err := time.Parse("01-02-06", text)
|
|
|
+ parsedTime, err := time.ParseInLocation("01-02-06", text, time.Local)
|
|
|
if err != nil {
|
|
|
- parsedTime, err = time.Parse("2006/01/02", text)
|
|
|
+ parsedTime, err = time.ParseInLocation("2006/01/02", text, time.Local)
|
|
|
if err != nil {
|
|
|
fmt.Println("解析时间字符串出错:", err)
|
|
|
return
|
|
@@ -1462,9 +1462,9 @@ func (this *CoalMineDataController) Inland() {
|
|
|
if len(text) < 6 {
|
|
|
dataTime = ExcelDateToDate(text).Format(utils.FormatDate)
|
|
|
} else {
|
|
|
- parsedTime, err := time.Parse("01-02-06", text)
|
|
|
+ parsedTime, err := time.ParseInLocation("01-02-06", text, time.Local)
|
|
|
if err != nil {
|
|
|
- parsedTime, err = time.Parse("2006/01/02", text)
|
|
|
+ parsedTime, err = time.ParseInLocation("2006/01/02", text, time.Local)
|
|
|
if err != nil {
|
|
|
utils.FileLog.Info("解析时间字符串出错:", err)
|
|
|
fmt.Println("解析时间字符串出错:", err)
|
|
@@ -1643,7 +1643,7 @@ func (this *CoalMineDataController) Firm() {
|
|
|
if k > 0 && text != "" {
|
|
|
month = text
|
|
|
month = utils.ConvertToFormatDay(month)
|
|
|
- time, _ := time.Parse(utils.FormatDate, month)
|
|
|
+ time, _ := time.ParseInLocation(utils.FormatDate, month, time.Local)
|
|
|
yearInt := time.Year()
|
|
|
monthInt := int(time.Month())
|
|
|
year = strconv.Itoa(yearInt)
|