/levels/{level-id}/timeseries endpoint truncates end time when duration not divisible by 1 day
@rma-psmorris is already working on this.
Since Apr 21, 2026.
- Dominant language
- Java
- Stars
- 28
- Forks
- 25
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 20
Description
Describe the bug
For the /levels/{level-id}/timeseries endpoint, a timeseries the end time/value pair isn't returned if the requested time frame isn't divisible by 1 day. This is problematic because some users don't request in day chunks (e.g. plotting on a website). There have been some workarounds on the front end code for this, but it would probably be better to fix in CDA (tangentially related issue with trying to finagle the front end to deal w/ it https://github.com/USACE-WaterManagement/groundwork-water/issues/225).
Expected behavior
For a begin and end, I would expect a return of times/values for the begin, end, and any inflection points in between. What is returned appears to be a daily value beginning at the begin time and if the end time doesn't match a day interval from the begin time, we end up missing the last time/value pair.
Request for 2.5 days Example (missing last date/value pair at end time)
https://cwms-data.usace.army.mil/cwms-data/levels/Baldhill_Dam.Elev.Inst.0.Bottom%20of%20Flood/timeseries?office=MVP&begin=2026-04-14T03% 3A32%3A39.992Z&end=2026-04-16T15%3A32%3A39.992Z&unit=ft
Requested: April 14 at 03:32 → April 16 at 15:32 (2.5 days)
Response:
{
"begin": "2026-04-14T03:32:39Z",
"end": "2026-04-16T03:32:39Z",
"interval": "PT0S",
"name": "Baldhill_Dam.Elev.Inst.0.0.Bottom of Flood",
"office-id": "MVP",
"total": 3,
"units": "ft",
"values": [
[1776137559000, 1265.0187189776864, 1],
[1776223959000, 1265.0760960268667, 1],
[1776310359000, 1265.133473076047, 1]
]
}
Returned timestamps:
- 2026-04-14 03:32:39 UTC
- 2026-04-15 03:32:39 UTC
- 2026-04-16 03:32:39 UTC (missing end time/value pair)
Problem: The response "end" field says "2026-04-16T03:32:39Z" but the requested end was 2026-04-16T15:32:39Z (12 hours later). The data stops
short of the requested time window.
Request for exactly 3 days example (returns all expected values)
https://cwms-data.usace.army.mil/cwms-data/levels/Baldhill_Dam.Elev.Inst.0.Bottom%20of%20Flood/timeseries?office=MVP&begin=2026-04-13T15% 3A27%3A30.160Z&end=2026-04-16T15%3A27%3A30.160Z&unit=ft
Requested: April 13 at 15:27 → April 16 at 15:27 (exactly 3 days)
Response:
{
"begin": "2026-04-13T15:27:30Z",
"end": "2026-04-16T15:27:30Z",
"interval": "PT0S",
"name": "Baldhill_Dam.Elev.Inst.0.0.Bottom of Flood",
"office-id": "MVP",
"total": 4,
"units": "ft",
"values": [
[1776094050000, 1264.989825250455, 1],
[1776180450000, 1265.0472022996353, 1],
[1776266850000, 1265.1045793488156, 1],
[1776353250000, 1265.1619563979962, 1]
]
}
Returned timestamps:
- 2026-04-13 15:27:30 UTC
- 2026-04-14 15:27:30 UTC
- 2026-04-15 15:27:30 UTC
- 2026-04-16 15:27:30 UTC (includes the requested end time)
CDA Version (please complete the following information):
2026.04.13-testa
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.