// DB No Seconds Format: 2007-12-05 12:00
Date.padded2=function(a){padded2=a.toString();if(parseInt(a)<10||parseInt(a)==null)padded2="0"+padded2;return padded2},Date.prototype.getAMPMHour=function(){return hour=Date.padded2(this.getHours()),hour==null?0:hour>24?hour-24:hour},Date.prototype.getAMPM=function(){return this.getHours()<12?"":""},Date.prototype.toFormattedString=function(a){return str=this.getFullYear()+"-"+(this.getMonth()+1)+"-"+Date.padded2(this.getDate()),a&&(hour=this.getHours(),str+=" "+this.getAMPMHour()+":"+this.getPaddedMinutes()),str},Date.parseFormattedString=function(a){var b="([0-9]{4})-(([0-9]{1,2})-(([0-9]{1,2})( ([0-9]{1,2}):([0-9]{2})? *)?)?)?",c=a.match(new RegExp(b,"i"));if(c==null)return Date.parse(a);var d=0,e=new Date(c[1],0,1);return c[3]&&e.setMonth(c[3]-1),c[5]&&e.setDate(c[5]),c[7]&&e.setHours(parseInt(c[7],10)),c[8]&&e.setMinutes(c[8]),c[10]&&e.setSeconds(c[10]),e}
