# HightLevelRestClient RangeQuery Date form parse error

**URL:** https://discuss.elastic.co/t/hightlevelrestclient-rangequery-date-form-parse-error/213059
**Category:** Elasticsearch
**Created:** [December 26, 2019, 9:14am UTC](https://discuss.elastic.co/t/hightlevelrestclient-rangequery-date-form-parse-error/213059 "2019-12-26T09:14:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dongshengYoung](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dongshengYoung](https://discuss.elastic.co/u/dongshengYoung)
#### Post date: [December 26, 2019, 9:14am UTC](https://discuss.elastic.co/t/hightlevelrestclient-rangequery-date-form-parse-error/213059/1 "2019-12-26T09:14:38Z")

</div>

when I using

> "yyyy-MM-dd'T'HH:mm:ss.SSSZ"

("Z" upperCase) in request body, has error,

but

> "yyyy-MM-dd'T'HH:mm:ss.SSSz"

("z" lowerCase) works?

my error:

```
"reason": {
                "type": "parse_exception",
                "reason": "failed to parse date field [2019-12-26T08:15:22.000Z] with format [yyyy-MM-dd'T'HH:mm:ss.SSSZ]: [Text '2019-12-26T08:15:22.000Z' could not be parsed at index 23]",
                "caused_by": {
                    "type": "date_time_parse_exception",
                    "reason": "Text '2019-12-26T08:15:22.000Z' could not be parsed at index 23"
                }
            }

```

my mapping:

```
"mappings" : {
  "properties" : {
    "eventEndTime" : {
      "type" : "date",
      "format" : "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
    }
  }
}

```

my request:

```
{
    "range": {
        "eventStartTime": {
            "from": null,
            "to": "2019-12-26T08:15:22.000Z",
            "include_lower": true,
            "include_upper": true,
            "format": "yyyy-MM-dd'T'HH:mm:ss.SSSZ",
            "boost": 1
        }
    }
}

```

---

<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: [January 23, 2020, 9:14am UTC](https://discuss.elastic.co/t/hightlevelrestclient-rangequery-date-form-parse-error/213059/2 "2020-01-23T09:14:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
