Skip to content
This repository has been archived by the owner on Jul 4, 2020. It is now read-only.

Commit

Permalink
Fixed date timezone in b3 data
Browse files Browse the repository at this point in the history
  • Loading branch information
almeida-raphael committed Jun 21, 2020
1 parent 531f37c commit 1b53dc6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/parser/history_parser.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package parser

import (
"fmt"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1b53dc6

Please sign in to comment.