You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何针对floating_timestamp类型的disp_date进行日期区间查询?

Correct Way to Query Floating Timestamp Ranges in Socrata API

Ah, I see the issue with your query—you're hitting a syntax quirk with how Socrata's API handles timestamp range filters! Your initial attempt tried to use between ... and ... directly as a top-level URL parameter, which the API doesn't recognize. Let's fix that, plus a quick date validity check first: February 2016 is a leap year, so it only has 29 days—2016-02-31 is an invalid date, so we'll use 2016-02-29T23:59:59.999 to capture all data up to the end of the month.

Here are two reliable ways to get your desired 2016 Jan-Feb data:

1. Use the $where Clause (Supports between Syntax)

This is the closest to what you originally tried. You need to wrap your between condition inside the $where parameter, and don't forget the single quotes around the timestamp values—those are mandatory here:

https://data.brla.gov/resource/4w4d-4es6.json?$where=disp_date between '2016-01-01T00:00:00.000' and '2016-02-29T23:59:59.999'

Most HTTP clients will handle URL encoding automatically, but if you're building the URL manually, just ensure the spaces and quotes are properly encoded (though modern browsers usually take care of this too).

2. Use Explicit Range Parameters

If you prefer a more straightforward approach without the $where clause, you can use >= and <= directly as query parameters. This works great for simple date range queries:

https://data.brla.gov/resource/4w4d-4es6.json?disp_date>=2016-01-01T00:00:00.000&disp_date<=2016-02-29T23:59:59.999

Either of these should eliminate the "unrecognized arguments" error you saw. Just double-check your date formats match the floating_timestamp requirements (ISO 8601 with milliseconds, which you're already doing correctly!) and you're good to go.

内容的提问来源于stack exchange,提问作者Dambo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 08:06:05