Fix use correct date to obtain prices (#983)
Co-authored-by: walker-16 <agpazos85@gmail.com>
This commit is contained in:
parent
d8d1d76a1e
commit
798da44152
|
@ -26,7 +26,7 @@ func (c *CoinPricesCache) GetPriceByTime(coingeckoID string, day time.Time) (dec
|
|||
|
||||
// remove hours and minutes,
|
||||
// times are in UTC
|
||||
day = time.Date(day.Year(), day.Month(), day.Day(), 0, 0, 0, 0, time.UTC)
|
||||
day = day.Truncate(24 * time.Hour).UTC()
|
||||
|
||||
// look up the price
|
||||
key := fmt.Sprintf("%s%d", coingeckoID, day.UnixMilli())
|
||||
|
|
Loading…
Reference in New Issue