# Mapping shows exception for leap year date

**URL:** https://discuss.elastic.co/t/mapping-shows-exception-for-leap-year-date/354439
**Category:** Elasticsearch
**Created:** [February 29, 2024, 11:48am UTC](https://discuss.elastic.co/t/mapping-shows-exception-for-leap-year-date/354439 "2024-02-29T11:48:37Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [February 29, 2024, 1:00pm UTC](https://discuss.elastic.co/t/mapping-shows-exception-for-leap-year-date/354439/4 "2024-02-29T13:00:50Z")

</div>

I think I be also answered this here.

> [@"MM-dd" mapping is not working, throwing exception in leap year day (feb 29, 2024))](https://discuss.elastic.co/t/mm-dd-mapping-is-not-working-throwing-exception-in-leap-year-day-feb-29-2024/354436/1):
>
> Hi Team, We have the below mapping for saving the date of birth and date of joining with the below format ("MM-dd"), but the system is taking the year 1970 (not a leap year) and throwing the exception Mapping : "dob": { "type": "date", "format": "MM-dd" }, "doj": { "type": "date", "format": "MM-dd" }, Exception: [56]:ElasticSerachDAO:indexDocument:exception: org.elasticsearch.index.mapper.MapperParsingException: failed to parse field [doj] of type [date] in document with id '2240280…

There is no instant fix...

@ahmed_charafouddine Provided one approach.

You could create an ingest pipeline with code to set the current year.

What version are you using?

---

_[View the full topic](https://discuss.elastic.co/t/mapping-shows-exception-for-leap-year-date/354439)._
