I want to map the following date String as it comes out of new Date().toString()
Thu Jul 03 19:17:19 CEST 2014 but ElasticSearch gives me always the Errormessage Invalid format: "Thu Jul 03 19:17:19 CEST 2014" is malformed at "CEST 2014" and I have no idea what goes wrong.
This is the mapping for the test type
{
"properties" : {
"postDate" : {
"type" : "date",
"format" : "EEE MMM dd HH:mm:ss z yyyy"
}
}
}
I think it has the right pattern. I even tried to increase the number of 'z', but same error. So is there a solution or do I have to find a diffrent approch.
new Date().toString()seems Javascript. But it doesn't seem to be giving me a date string like you have shared in Chrome's console. Anyways, your format is right butCESTis not recognized by ES for some reason. If you manually try to index the same document with some other timezone likePST, it works. Not sure what's wrong.