# Custom date format

**URL:** <https://discuss.elastic.co/t/custom-date-format/9866>\
**Category:** Elasticsearch\
**Created:** [November 28, 2012, 3:36pm UTC](https://discuss.elastic.co/t/custom-date-format/9866 "2012-11-28T15:36:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ku3ia](https://avatars.discourse-cdn.com/v4/letter/k/c89c15/32.png) [@ku3ia](https://discuss.elastic.co/u/ku3ia)\
**Post date:** [November 28, 2012, 3:36pm UTC](https://discuss.elastic.co/t/custom-date-format/9866/1 "2012-11-28T15:36:33Z")

</div>

Hi  
I'm newbie at Elastic, please advice.

I have a schema:

curl -XPOST 10.112.1.2:9200/search -d '  
{  
"index" : {  
"analysis" : {  
"analyzer" : {  
"mCustom" : {  
"type" : "custom",  
"tokenizer" : "standard",  
"filter" : [ "standard", "lowercase", "kstem", "trim", "mStop",  
"mLength" ]  
}  
},  
"filter" : {  
"mStop" : {  
"type" : "stop",  
"stopwords\_path" : "/opt/elastic/config/stopwords"  
},  
"mLength" : {  
"type" : "length",  
"min" : 2,  
"max" : 50  
}  
}  
}  
},

"mappings" : {  
"storage" : {  
"\_source" : { "enabled" : true },  
"\_all" : { enabled : false },  
"\_id" : { path: "RecordID"},  
"properties" : {  
"Date" : { "type" : "date", "store" : "true", "index"  
: "analyzed", "format" : "yyyy-MM-ddTHH:mm:ss.SSSZ||yyyy-MM-ddTHH:mm:ssZ",  
"precision\_step:" : 6 },  
"Name" : { "type" : "string", "store" : "true", "index"  
: "analyzed" },  
"RecordID" : { "type" : "long", "store" : "true", "index"  
: "not\_analyzed" },  
"URL" : { "type" : "string", "store" : "true", "index"  
: "no" }  
}  
}  
}  
}'

My question is: how to define custom multiple data format with T separator?  
Is it possible? I need to index at formats "2012-11-28T15:16:17Z"  
or "2012-11-28T15:16:17.003Z"  
Seems possible, because it fixed at

> <https://github.com/elastic/elasticsearch/issues/977>

My formats are the same as "date\_time||date\_time\_no\_millis" but I can't use  
it because there is a bug

> <https://github.com/elastic/elasticsearch/issues/2132>

Thanks.

--

---

<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, 3:02am UTC](https://discuss.elastic.co/t/custom-date-format/9866/2 "2017-07-06T03:02:26Z")

</div>


