Get the current year in Javascript

Was trying to figure out how to get the current year value ie. 2017 using Javascript. Below is the quickest way I could find to get it

$end_value = (new Date()).getFullYear() ;

Justin Kelly

Justin Kelly

Web Developer, Business Analytics, Data Engineer specialising in PHP and Tableau

Based in Melbourne, Australia

Feel free to contact me justin@kelly.org.au or _justin_kelly

Leave a comment

Name Notify me of replies by email.