# Extract 'Year' from 'new Date()' function in Kibana scripted field

**URL:** <https://discuss.elastic.co/t/extract-year-from-new-date-function-in-kibana-scripted-field/244463>\
**Category:** Kibana\
**Created:** [August 10, 2020, 8:44pm UTC](https://discuss.elastic.co/t/extract-year-from-new-date-function-in-kibana-scripted-field/244463 "2020-08-10T20:44:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Aaron\_Caldwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron_caldwell/32/45755_2.png) [@Aaron\_Caldwell](https://discuss.elastic.co/u/Aaron_Caldwell)\
**Post date:** [August 11, 2020, 12:49pm UTC](https://discuss.elastic.co/t/extract-year-from-new-date-function-in-kibana-scripted-field/244463/2 "2020-08-11T12:49:54Z")

</div>

Hello Mike,

You should be able to use `new SimpleDateFormat('yyyy')` to grab the year. Reference: [Scripted fields date parse](https://discuss.elastic.co/t/scripted-fields-date-parse/167241).

Regards,  
Aaron

---

_[View the full topic](https://discuss.elastic.co/t/extract-year-from-new-date-function-in-kibana-scripted-field/244463)._
