How to format a date using JScript

The JScript Date object lets you get its independent parts (day, month, year) so you can grab those and format them how you like - see below for an example. I don't know if there's a "format date" function or not.

var today = new Date();
var twoDigitYear = today.getYear();
twoDigitYear -= (twoDigitYear > 1999) ? 2000 : 1900;
DOpus.Output(zeroFill(twoDigitYear,2) + zeroFill(today.getMonth(), 2) + zeroFill(today.getDate(), 2));

function zeroFill( number, width )
{
  width -= number.toString().length;
  if ( width > 0 )
  {
    return new Array( width + (/\./.test( number ) ? 2 : 1) ).join( '0' ) + number;
  }
  return number + ""; // always return a string
}