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