Merge pull request #654 from zenixls2/fix/UTC

fix: change from local timezone to UTC when do kline synchronization
This commit is contained in:
Yo-An Lin 2022-06-02 16:52:19 +08:00 committed by GitHub
commit 396accbf55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -106,7 +106,7 @@ func NewEnvironment() *Environment {
// default trade scan time
syncStartTime: time.Now().AddDate(-1, 0, 0), // defaults to sync from 1 year ago
sessions: make(map[string]*ExchangeSession),
startTime: time.Now(),
startTime: time.Now().UTC(),
syncStatus: SyncNotStarted,
PersistenceServiceFacade: &service.PersistenceServiceFacade{

View File

@ -24,7 +24,7 @@ func (e *KLineBatchQuery) Query(ctx context.Context, symbol string, interval typ
})
},
T: func(obj interface{}) time.Time {
return time.Time(obj.(types.KLine).StartTime)
return time.Time(obj.(types.KLine).StartTime).UTC()
},
ID: func(obj interface{}) string {
kline := obj.(types.KLine)