Energinet: fix timestamps
This commit is contained in:
parent
5e6f861ed3
commit
22859abd13
2 changed files with 6 additions and 3 deletions
|
|
@ -66,8 +66,8 @@ func (t *Energinet) run(done chan error) {
|
|||
|
||||
ts := time.Now().Truncate(time.Hour)
|
||||
uri := fmt.Sprintf(energinet.URI,
|
||||
ts.Format(time.RFC3339),
|
||||
ts.Add(24*time.Hour).Format(time.RFC3339),
|
||||
ts.Format(energinet.TimeFormat),
|
||||
ts.Add(24*time.Hour).Format(energinet.TimeFormat),
|
||||
t.region)
|
||||
|
||||
if err := backoff.Retry(func() error {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package energinet
|
||||
|
||||
const URI = "https://api.energidataservice.dk/dataset/Elspotprices?offset=0&start=%s&end=%s&filter={\"PriceArea\":[\"%s\"]}&timezone=dk&limit=48"
|
||||
const (
|
||||
URI = "https://api.energidataservice.dk/dataset/Elspotprices?offset=0&start=%s&end=%s&filter={\"PriceArea\":[\"%s\"]}&timezone=dk&limit=48"
|
||||
TimeFormat = "2006-01-02T15:04" // RFC3339 short
|
||||
)
|
||||
|
||||
type Prices struct {
|
||||
Records []PriceInfo `json:"records"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue