Skip to content

Commit bfa5b11

Browse files
committed
Fix date/time format described in README.md
1 parent 493cadf commit bfa5b11

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

README.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,15 @@ Parameters
128128
| Parameter | Description |
129129
| -------------- | ----------------------------------------------------- |
130130
| `smartMeterId` | One of the smart meters' id listed above |
131-
| `time` | The date/time (as epoch) when the _reading_ was taken |
131+
| `time` | The date/time (as RFC3399) when the _reading_ was taken |
132132
| `reading` | The consumption in `kW` at the _time_ of the reading |
133133

134134
Example readings
135135

136-
| Date (`GMT`) | Epoch timestamp | Reading (`kW`) |
137-
| ----------------- | --------------: | -------------: |
138-
| `2020-11-29 8:00` | 1606636800 | 0.0503 |
139-
| `2020-11-29 8:01` | 1606636860 | 0.0621 |
140-
| `2020-11-29 8:02` | 1606636920 | 0.0222 |
141-
| `2020-11-29 8:03` | 1606636980 | 0.0423 |
142-
| `2020-11-29 8:04` | 1606637040 | 0.0191 |
136+
| Date (`GMT`) | RFC3399 | Reading (`kW`) |
137+
| ----------------- | ----------------------------- | -------------: |
138+
| `2020-11-11 8:00` | `2020-11-18T08:00:00.725202Z` | 0.0503 |
139+
| `2020-11-12 8:00` | `2020-11-18T08:00:00.725202Z` | 0.0213 |
143140

144141
In the above example, the smart meter sampled readings, in `kW`, every minute. Note that the reading is in `kW` and
145142
not `kWH`, which means that each reading represents the consumption at the reading time. If no power is being consumed
@@ -155,7 +152,7 @@ $ curl \
155152
-X POST \
156153
-H "Content-Type: application/json" \
157154
"http://localhost:8080/readings/store" \
158-
-d '{"smartMeterId":"smart-meter-0","electricityReadings":[{"time":1606636800,"reading":0.0503},{"time":1606636860,"reading":0.0621},{"time":1606636920,"reading":0.0222},{"time":1606636980,"reading":0.0423},{"time":1606637040,"reading":0.0191}]}'
155+
-d '{"smartMeterId":"smart-meter-0","electricityReadings":[{"time":"2020-11-18T08:00:00.725202Z","reading":0.0503},{"time":"2020-11-18T08:00:00.725202Z","reading":0.0213}]}'
159156
```
160157

161158
The above command does not return anything.
@@ -187,23 +184,23 @@ Example output
187184
"readings": [
188185
{
189186
"reading": 0.4,
190-
"time": "2021-08-20T07:04:49"
187+
"time": "2021-08-20T07:04:49.000000Z"
191188
},
192189
{
193190
"reading": 0.123,
194-
"time": "2021-08-20T07:07:49"
191+
"time": "2021-08-20T07:07:49.000000Z"
195192
},
196193
{
197194
"reading": 0.23,
198-
"time": "2021-08-20T07:10:49"
195+
"time": "2021-08-20T07:10:49.000000Z"
199196
},
200197
{
201198
"reading": 0.432,
202-
"time": "2021-08-20T07:13:49"
199+
"time": "2021-08-20T07:13:49.000000Z"
203200
},
204201
{
205202
"reading": 0.44,
206-
"time": "2021-08-20T07:16:49"
203+
"time": "2021-08-20T07:16:49.000000Z"
207204
}
208205
]
209206
}

0 commit comments

Comments
 (0)