# Use of dateOptionalTime Date field format

**URL:** <https://discuss.elastic.co/t/use-of-dateoptionaltime-date-field-format/10539>\
**Category:** Elasticsearch\
**Created:** [January 29, 2013, 3:18pm UTC](https://discuss.elastic.co/t/use-of-dateoptionaltime-date-field-format/10539 "2013-01-29T15:18:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JP\_Toto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jp_toto/32/2512_2.png) [@JP\_Toto](https://discuss.elastic.co/u/JP_Toto)\
**Post date:** [January 29, 2013, 3:18pm UTC](https://discuss.elastic.co/t/use-of-dateoptionaltime-date-field-format/10539/1 "2013-01-29T15:18:14Z")

</div>

Hey all!

Just a quick question (hopefully). I'd like to use dateOptionalTime date  
format on my schema for a date field. My dates are ISO so they look like

2013-01-24T10:08:22-05:00

or

2013-01-24T10:09:48.989-05:00

My testing shows this has worked out fine but just wanted to see if there  
are any caveats.

Thanks!

--  
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:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [January 29, 2013, 9:17pm UTC](https://discuss.elastic.co/t/use-of-dateoptionaltime-date-field-format/10539/2 "2013-01-29T21:17:59Z")

</div>

Hello James,

I don't see any caveats. And by that I mean I don't see any advantage of  
adding .000 to the dates that have no milliseconds, versus your current  
approach.

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

On Tue, Jan 29, 2013 at 5:18 PM, JP Toto [james.p.toto@gmail.com](mailto:james.p.toto@gmail.com) wrote:

> Hey all!
> 
> Just a quick question (hopefully). I'd like to use dateOptionalTime date  
> format on my schema for a date field. My dates are ISO so they look like
> 
> 2013-01-24T10:08:22-05:00
> 
> or
> 
> 2013-01-24T10:09:48.989-05:00
> 
> My testing shows this has worked out fine but just wanted to see if there  
> are any caveats.
> 
> Thanks!
> 
> --  
> 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:54am UTC](https://discuss.elastic.co/t/use-of-dateoptionaltime-date-field-format/10539/3 "2017-07-06T02:54:08Z")

</div>


