# Passing date field throw rest

**URL:** https://discuss.elastic.co/t/passing-date-field-throw-rest/12071
**Category:** Elasticsearch
**Created:** [May 22, 2013, 10:26am UTC](https://discuss.elastic.co/t/passing-date-field-throw-rest/12071 "2013-05-22T10:26:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ahmed\_Merghani](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Ahmed\_Merghani](https://discuss.elastic.co/u/Ahmed_Merghani)
#### Post date: [May 22, 2013, 10:26am UTC](https://discuss.elastic.co/t/passing-date-field-throw-rest/12071/1 "2013-05-22T10:26:16Z")

</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,

---

<div class="post-metadata">

### Author: ![Ahmed\_Merghani](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@Ahmed\_Merghani](https://discuss.elastic.co/u/Ahmed_Merghani)
#### Post date: [May 23, 2013, 11:35am UTC](https://discuss.elastic.co/t/passing-date-field-throw-rest/12071/2 "2013-05-23T11:35:06Z")

</div>

Hi,

I noticed that the REST return an error:  
Code: 52  
Message: Empty reply from the server

Any help will be appreciated.

---

<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/12071/3 "2017-07-06T02:35:06Z")

</div>


