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