I have a DateTime property in the data returned by a service that looks like "SDateTime":"2014-06-29T03:30:00.000" .
"SDateTime":"2014-06-29T03:30:00.000"
I need to write a request to get a collection with a date less than "2014-06-26T03: 30: 00.000" and more than "2014-06-23T03: 30: 00.000"
How to write a filter for dateTime?
Thank you
$ filter = SDateTime gt datetime'2014-06-26T03: 30: 00.000 'and SDateTime lt datetime'2014-06-23T03: 30: 00.000'
He works in this service: http://services.odata.org/V3/OData/OData.svc/Products?$filter=ReleaseDate%20gt%20datetime%271995- 09-01T00: 00: 00% 27% 20and% 20ReleaseDate % 20lt% 20datetime% 271995-12-01T00: 00: 00% 27
In OData V4, the date filtering format has been changed, the correct filter will be
$filter=SDateTime gt 2014-06-23T03:30:00.000Z and SDateTime lt 2014-06-26T03:30:00.000Z
For instance,
http://services.odata.org/V4/OData/OData.svc/Products?%24filter=ReleaseDate%20gt%201995-09-01T00:00:00Z%20and%20ReleaseDate%20lt%201995-12-01T00:00 : 00Z
For previous versions of OData, see the previous answer.
Breeze will automatically create an OData filter under the covers for any request. Thus, a date request will look something like this in Breeze.
var query = new EntityQuery("Orders") .where("orderDate", ">", new Date(1998, 3, 1));
Source: https://habr.com/ru/post/971532/More articles:Android - Get images for the Samsung S4 / S5 gallery - androidGroup rows in a DataGridView - c #Why is private static field = new Singleton not lazy in Java? - javaMongodb set _id as a measure of reduction - indexingGIT :: Merging 2 branches rewrites content in one branch with another - gitHow to install PySide on Travis? - pythonProblem with NAT bypass with video conferencing using webrtc - phpSwift: optional array counter - arraysimplementation of various classes based on template parameter - c ++Grails maven plugin wants Groovy 2.4.2 - javaAll Articles