function dateBehavior(){
   this.databaseDate = "";
   this.completeDate = "";

   String.prototype.repeat = function(n) {
      return new Array(1 + parseInt(n, 10)).join(this);
   }

   this.nowFormat = function(formato){
      oStr = new strBehavior();
      formato = formato.toUpperCase();
      now = new Date();
      day = oStr.fillChar("0", now.getDate(), 2);
      month = oStr.fillChar("0", now.getMonth() + 1, 2);
      year = now.getYear();

      hour = oStr.fillChar("0", now.getHours(), 2);
      minute = oStr.fillChar("0", now.getMinutes(), 2);
      second = oStr.fillChar("0", now.getSeconds(), 2);

      expReg = new RegExp("DD", "g");
      formato = formato.replace(expReg, day);

      expReg = new RegExp("MM", "g");
      formato = formato.replace(expReg, month);

      expReg = new RegExp("YYYY", "g");
      formato = formato.replace(expReg, year);

      expReg = new RegExp("HH", "g");
      formato = formato.replace(expReg, hour);

      expReg = new RegExp("NN", "g");
      formato = formato.replace(expReg, minute);

      expReg = new RegExp("SS", "g");
      formato = formato.replace(expReg, second);

      return(formato);

      oStr = null;
   }
}

