-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Serialization of DateTime when TimeSeparator is a Dot #1227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @alkampfergit, apologies for the delay. Agreed, we should probably be ignoring culture here and it seems we're a bit inconsistent where we do and don't. For instance, in the Can you share the exact query you're running? I'm assuming it's probably the |
I have a similar problem, Im trying to execute a QueryRaw with a Datetime, the query generated is Im my case I parse the datetime to a string with format InvariantCulture |
I've a unit test where I'm able to repro the problem, I explicitly set Italian culture with a dot as separator for DateTimeFormat.TimeSeparator
The query fails with an exception
ElasticsearchParseException[failed to parse date field [2015-01-30T08.52.32.443], tried both date format [dateOptionalTime], and timestamp number]; nested: IllegalArgumentException[Invalid format: "2015-01-30T08.52.32.443" is malformed at ".32.443"]
I Elastic Search needs semicolon to separate hours, minutes and milliseconds, and rejects the query. When a DateTime is converted to string, localization should not be considered.
Actually I've patched my code using string instead of DateTime in Nest query.
The text was updated successfully, but these errors were encountered: