# Date formats do they really use camelCase or under\_bars?

**URL:** <https://discuss.elastic.co/t/date-formats-do-they-really-use-camelcase-or-under-bars/12885>\
**Category:** Elasticsearch\
**Created:** [July 22, 2013, 7:29pm UTC](https://discuss.elastic.co/t/date-formats-do-they-really-use-camelcase-or-under-bars/12885 "2013-07-22T19:29:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Douglas\_Moore](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@Douglas\_Moore](https://discuss.elastic.co/u/Douglas_Moore)\
**Post date:** [July 22, 2013, 7:29pm UTC](https://discuss.elastic.co/t/date-formats-do-they-really-use-camelcase-or-under-bars/12885/1 "2013-07-22T19:29:09Z")

</div>

The documentation[http://www.elasticsearch.org/guide/reference/mapping/date-format/](http://www.elasticsearch.org/guide/reference/mapping/date-format/)on date-formats suggest to get yyyyMMdd format mapping to use "format":  
"basic\_date".  
However, when querying the \_mapping for a type with a "type":"date", I get  
"format":"dateOptionalTime" instead of "date\_optional\_time" as per the  
documentation.

So what is it, camelCase or under\_bars when specifying date formats?  
Could someone update the documentation please?

Thanks much,  
Douglas

--  
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:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 23, 2013, 6:22am UTC](https://discuss.elastic.co/t/date-formats-do-they-really-use-camelcase-or-under-bars/12885/2 "2013-07-23T06:22:00Z")

</div>

Hey

both work, you can specifiy the date either using camel case or the  
snake\_case. If you do not specify anything the camelCase version is  
returned.

--Alex

On Mon, Jul 22, 2013 at 9:29 PM, Douglas Moore [dmoore247@gmail.com](mailto:dmoore247@gmail.com) wrote:

> The documentation[http://www.elasticsearch.org/guide/reference/mapping/date-format/](http://www.elasticsearch.org/guide/reference/mapping/date-format/)on date-formats suggest to get yyyyMMdd format mapping to use "format":  
> "basic\_date".  
> However, when querying the \_mapping for a type with a "type":"date", I get  
> "format":"dateOptionalTime" instead of "date\_optional\_time" as per the  
> documentation.
> 
> So what is it, camelCase or under\_bars when specifying date formats?  
> Could someone update the documentation please?
> 
> Thanks much,  
> Douglas
> 
> --  
> 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).

--  
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:25am UTC](https://discuss.elastic.co/t/date-formats-do-they-really-use-camelcase-or-under-bars/12885/3 "2017-07-06T02:25:07Z")

</div>


