how to get the current full year in javascript code example Example: get year from date javascript document.write(new Date().getFullYear());