title: ElasticSearch Script get value of current year
body: <p>I'm trying to make a script within my rescore function to check if the bibliographic release date (doc['bibliografische_verschijningsdatum']), is the same as the commercial release date (doc['verschijningsdatum']).</p>
  
  <p>AND the doc['verschijningsjaar'].value == new Date.getYear()</p>
  
  <p><strong>How can I get the year of todays date in painless?</strong></p>
  
  <pre><code>"script_score": {
            "script": "((doc['verschijningsdatum'] == doc['bibliografische_verschijningsdatum']) &amp;&amp; (doc['verschijningsjaar'].value == new Date().getYear()) ? 1 : 0)"
          }
        }
  </code></pre>