tempestas

A REST API for processing sensor.community data
git clone https://git.bracken.jp/tempestas.git
Log | Files | Refs | README | LICENSE

commit 89cf478e17e9c7fef4214bf8c45e222b710ebb8e
parent fb529558596f8b4ac1bd76cc2c36473324ddd2a7
Author: Chris Bracken <chris@bracken.jp>
Date:   Fri, 12 Nov 2021 17:14:08 -0800

Specify start/end in UTC when querying readings

Since readings are stored in UTC form, we convert the query start/end
times to UTC before querying the database.

Diffstat:
Mhttp/http.go | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/http/http.go b/http/http.go @@ -55,8 +55,8 @@ func (s HttpServer) PostAirrohr(w http.ResponseWriter, r *http.Request) { } func (s HttpServer) QueryReadings(w http.ResponseWriter, r *http.Request) { - start := time.Now().Add(time.Hour * -24) - end := time.Now() + start := time.Now().Add(time.Hour * -24).UTC() + end := time.Now().UTC() sensorId := pat.Param(r, "sensorId") readingType := pat.Param(r, "readingType")