# "MM-dd" mapping is not working, throwing exception in leap year day (feb 29, 2024))

**URL:** https://discuss.elastic.co/t/mm-dd-mapping-is-not-working-throwing-exception-in-leap-year-day-feb-29-2024/354436
**Category:** Elasticsearch
**Created:** [February 29, 2024, 11:32am UTC](https://discuss.elastic.co/t/mm-dd-mapping-is-not-working-throwing-exception-in-leap-year-day-feb-29-2024/354436 "2024-02-29T11:32:24Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![navaneethan](https://avatars.discourse-cdn.com/v4/letter/n/f17d59/32.png) [@navaneethan](https://discuss.elastic.co/u/navaneethan)
#### Post date: [February 29, 2024, 11:32am UTC](https://discuss.elastic.co/t/mm-dd-mapping-is-not-working-throwing-exception-in-leap-year-day-feb-29-2024/354436/1 "2024-02-29T11:32:24Z")

</div>

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:

```auto
[56]:ElasticSerachDAO:indexDocument:exception:
org.elasticsearch.index.mapper.MapperParsingException: failed to parse field [doj] of type [date] in document with id '2240280'. Preview of field's value: '02-29'
	
Caused by: org.elasticsearch.common.io.stream.NotSerializableExceptionWrapper: date_time_exception: Invalid date 'February 29' as '1970' is not a leap year	

```

Please review and update us on this

---

_[View the full topic](https://discuss.elastic.co/t/mm-dd-mapping-is-not-working-throwing-exception-in-leap-year-day-feb-29-2024/354436)._
