# DateMath from DateTime.MinValue

**URL:** <https://discuss.elastic.co/t/datemath-from-datetime-minvalue/132347>\
**Category:** Elasticsearch\
**Created:** [May 17, 2018, 1:43pm UTC](https://discuss.elastic.co/t/datemath-from-datetime-minvalue/132347 "2018-05-17T13:43:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![die\_seltsame](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/die_seltsame/32/29303_2.png) [@die\_seltsame](https://discuss.elastic.co/u/die_seltsame)\
**Post date:** [May 17, 2018, 1:43pm UTC](https://discuss.elastic.co/t/datemath-from-datetime-minvalue/132347/1 "2018-05-17T13:43:07Z")

</div>

I'm trying to search for a date that is greater than `DateTime.MinValue,` but elastic throws search\_phase\_execution\_exception. When I create `var d = DateMath.Anchored(DateTime.MinValue)` , `d.Self = null and d.ToString()` returns `String.Empty`. I do not observe this behavior with other dates, f.e. with `DateTime.MaxValue`.

```
 "range": {
                  "eventDateUtc": {
                    "gte": "0001-01-01T00:00:00"
                  }
                }

```

How can I make this filter using Nest? Elasticsearch can search dates that are greater than DateTime.MinValue.

I am using Nest 6.0.0 and Elastic 6.2.0

Why isValid is defined in this way?

> <https://github.com/elastic/elasticsearch-net/blob/master/src/Nest/CommonOptions/DateMath/DateMath.cs#L84>

---

<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:** [June 14, 2018, 1:43pm UTC](https://discuss.elastic.co/t/datemath-from-datetime-minvalue/132347/2 "2018-06-14T13:43:22Z")

</div>

Closed on June 14, 2018, 1:43pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
