function yyyymmdd(date) {
  Date.prototype.yyyymmdd = function () {
    const mm = this.getMonth() + 1; // getMonth() is zero-based
    const dd = this.getDate();
  
    return [this.getFullYear(), (mm > 9 ? '' : '0') + mm, (dd > 9 ? '' : '0') + dd].join('');
  };
  
  return new Date(date).yyyymmdd();
}
/**************************************************************************
 Returns YYYYMMDD format of the date
 Params:
 - date
 Returns:
 - time in format YYYYMMDD
 **************************************************************************/
Returns YYYYMMDD format of the date
Params:
date
Returns:
time in format YYYYMMDD
Returns YYYYMMDD format of the date Params : date Returns : time in format YYYYMMDD
function yyyymmdd(date) {
  Date.prototype.yyyymmdd = function () {
    const mm = this.getMonth() + 1; 
    const dd = this.getDate();
    return [this.getFullYear(), (mm > 9 ? '' : '0') + mm, (dd > 9 ? '' : '0') + dd].join('');
  };
  return new Date(date).yyyymmdd();
}
function yyyymmdd ( date ) { Date . prototype . yyyymmdd = function ( ) { const mm = this . getMonth ( ) + 1 ; const dd = this . getDate ( ) ; return [ this . getFullYear ( ) , ( mm > 9 ? '' : '0' ) + mm , ( dd > 9 ? '' : '0' ) + dd ] . join ( '' ) ; } ; return new Date ( date ) . yyyymmdd ( ) ; }
Returns YYYYMMDD format of the date
Params:
 date
Returns:
 time in format YYYYMMDD
Returns YYYYMMDD format of the date Params : date Returns : time in format YYYYMMDD
// getMonth() is zero-based