From 1b53dc6a63e598fdac354f65bd328bbad14b7c22 Mon Sep 17 00:00:00 2001 From: "Raphael C. Almeida" Date: Sun, 21 Jun 2020 11:42:00 -0300 Subject: [PATCH] Fixed date timezone in b3 data --- pkg/parser/history_parser.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/parser/history_parser.go b/pkg/parser/history_parser.go index 71d1cee..a08394c 100644 --- a/pkg/parser/history_parser.go +++ b/pkg/parser/history_parser.go @@ -1,6 +1,7 @@ package parser import ( + "fmt" "strconv" "strings" "time" @@ -73,12 +74,10 @@ func parseContentLine(rawLine string, year int) (*models.AssetInfo, error) { if err != nil { return nil, err } - expirationDate, err := time.Parse("20060102", rawLine[202:202+8]) + expirationDate, err := time.Parse("20060102 -0700", fmt.Sprintf("%s -3000", rawLine[202:202+8])) if err != nil { return nil, err } - loc, _ := time.LoadLocation("America/Sao_Paulo") - expirationDate = expirationDate.In(loc) fatCot, err := strconv.ParseInt(rawLine[210:210+7], 10, 64) if err != nil { return nil, err