Skip to content

HistogramItem's Date property has unspecified DateTime Kind #1626

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

Closed
rokeller opened this issue Nov 18, 2015 · 1 comment
Closed

HistogramItem's Date property has unspecified DateTime Kind #1626

rokeller opened this issue Nov 18, 2015 · 1 comment

Comments

@rokeller
Copy link

Despite the fact that ElasticSearch's response includes time zone information, the parsed value in the Date property of HistogramItem instances has the Kind property set to 'Unspecified', which is just wrong. I.e. the following Assert would fail:

HistogramItem histogramItem = // ... get from ElasticSearch
Assert.AreNotEqual(DateTimeKind.Unspecified, histogramItem.Date.Kind, "The DateTime Kind must not be Unspecified");

Since the timezone information is present, it should be parsed with that and then accordingly the DateTimeKind should be set on the parsed value.

This is for 1.7.1

@Mpdreamz Mpdreamz added the v1.7.2 label Jan 6, 2016
@gmarz gmarz added this to the 1.7.2 milestone Jan 14, 2016
@gmarz gmarz removed the v1.7.2 label Jan 14, 2016
@gmarz gmarz removed this from the 1.7.2 milestone Jan 25, 2016
@Mpdreamz
Copy link
Member

Mpdreamz commented Mar 7, 2016

Sorry for the late reply, elasticsearch stores and returns dates in utc so we should specify DateTimeKind.Utc.

This also needs forward porting to 2.x

Thanks for reporting this issue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants