I\'m trying to use JS to turn a date object into a string in YYYYMMDD format. Is there an easier way than concatenating Date.getYear()
date object
YYYYMMDD
Date.getYear()
date-shortcode to the rescue!
const dateShortcode = require('date-shortcode') dateShortcode.parse('{YYYYMMDD}', new Date()) //=> '20180304'