var formatL = moment.localeData().longDateFormat('L'); var formatYearlessL = formatL.replace(/YYYY/g,'YY'); console.log(moment().format(formatYearlessL));