# Date is too short

**URL:** https://discuss.elastic.co/t/date-is-too-short/141037
**Category:** Elasticsearch
**Created:** [July 22, 2018, 3:52pm UTC](https://discuss.elastic.co/t/date-is-too-short/141037 "2018-07-22T15:52:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![magedmakled](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magedmakled/32/69937_2.png) [@magedmakled](https://discuss.elastic.co/u/magedmakled)
#### Post date: [July 22, 2018, 3:52pm UTC](https://discuss.elastic.co/t/date-is-too-short/141037/1 "2018-07-22T15:52:01Z")

</div>

I'm using Elasticsearch with ruby. I have a Date field that is a Datetime converted to "iso8601" on the format "2018-07-29T13:00:00Z" . the field is formatted as a date\_time\_no\_millis

attribute :starts\_at, Date, mapping: { format: "date\_time\_no\_millis" }

The problem is I'm getting date is too short, any suggestions

Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":{"root\_cause":[{"type":"mapper\_parsing\_exception","reason":"failed to parse [starts\_at]"}],"type":"mapper\_parsing\_exception","reason":"failed to parse [starts\_at]","caused\_by":{"type":"illegal\_argument\_exception","reason":"Invalid format: "2018-07-29" is too short"}},"status":400}

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [July 22, 2018, 8:47pm UTC](https://discuss.elastic.co/t/date-is-too-short/141037/2 "2018-07-22T20:47:15Z")

</div>

It's easier for us to help if you keep the question to one thread 🙂

> [@Date Invalid format too short](https://discuss.elastic.co/t/date-invalid-format-too-short/141046):
>
> I have an elasticsearch model with a field starts\_at with the mapping "starts\_at": { "type": "date", "format": "yyyy-MM-dd'T'HH:mm:ssZ" } When I try to enter 2018-07-29T13:00:00Z, I get the error Invalid format: \"2018-07-29\" is too short" Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":{"root\_cause":[{"type":"mapper\_parsing\_exception","reason":"failed to parse [starts\_at]"}],"type":"mapper\_parsing\_exception","reason":"failed…

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [July 22, 2018, 8:47pm UTC](https://discuss.elastic.co/t/date-is-too-short/141037/3 "2018-07-22T20:47:18Z")

</div>


