javascript dateNow year code example Example: JS date year var d = new Date(); var n = d.getFullYear();