Avatar

Level 4
Level 4

You might want to splice the Date object by injecting the following code (preferably into a script object):

Date.prototype.ddmmyy = function() { 
   var yy = this.getFullYear().toString().substr(2,3);
   var mm = (this.getMonth()+1).toString();
   var dd  = this.getDate().toString();
   return (dd[1]?dd:"0"+dd[0]) + (mm[1]?mm:"0"+mm[0]) + (yy[1]?yy:"0"+yy[0]);
  };

Now you can have the javascript Date object deliver your custom formatting, for instance:

d = new Date(); 
app.alert(d.ddmmyy()); // Outputs 210610