# Passing date field throw rest

**URL:** https://discuss.elastic.co/t/passing-date-field-throw-rest/12095
**Category:** Elasticsearch
**Created:** [May 23, 2013, 12:07pm UTC](https://discuss.elastic.co/t/passing-date-field-throw-rest/12095 "2013-05-23T12:07:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![abdo](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@abdo](https://discuss.elastic.co/u/abdo)
#### Post date: [May 23, 2013, 12:07pm UTC](https://discuss.elastic.co/t/passing-date-field-throw-rest/12095/1 "2013-05-23T12:07:46Z")

</div>

Hi all,

I am using PHP to write REST query to ES .I am trying to search my ES with  
a query that contains date field. This is my query:  
{"query":{"bool":{"must":{"range":{"timeGenerated":{"from":"2013/4/1  
09:14:08","to":"2013/4/1 09:14:08"}}}}}}

When I try this query it gives me no response from server -not empty-. When  
I remove the time portion from the date, it works!  
{"query":{"bool":{"must":{"range":{"timeGenerated":{"from":"2013/4/1","to":"2013/4/1"}}}}}}

Also I tried the tow queries from curl command line and it works fine.

regards,

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 2:35am UTC](https://discuss.elastic.co/t/passing-date-field-throw-rest/12095/2 "2017-07-06T02:35:06Z")

</div>


