Nodejs Date Format shortFormat()

Here you can find the source of shortFormat()

Method Source Code

Date.prototype.shortFormat = function() {
   return (this.getMonth() + 1) + "/" + this.getDate() + "/" + this.getFullYear();
};

Related

  1. pattern(fmt)
    Date.prototype.pattern=function(fmt) {      
        var o = {      
        "M+" : this.getMonth()+1, 
        "d+" : this.getDate(), 
        "h+" : this.getHours()%12 == 0 ? 12 : this.getHours()%12, 
        "H+" : this.getHours(), 
        "m+" : this.getMinutes(), 
        "s+" : this.getSeconds(), 
        "q+" : Math.floor((this.getMonth()+3)/3), 
    ...
    
  2. pattern(fmt)
    Date.prototype.pattern=function(fmt) {
        var o = {
            "M+" : this.getMonth()+1, 
            "d+" : this.getDate(), 
            "h+" : this.getHours()%12 == 0 ? 12 : this.getHours()%12, 
            "H+" : this.getHours(), 
            "m+" : this.getMinutes(), 
            "s+" : this.getSeconds(), 
            "q+" : Math.floor((this.getMonth()+3)/3), 
    ...
    
  3. pattern(fmt)
    Date.prototype.pattern = function (fmt) {
        var set = {
            "M+": this.getMonth() + 1,
            "d+": this.getDate(),
            "h+": this.getHours() % 12 == 0 ? 12 : this.getHours() % 12,
            "H+": this.getHours(),
            "m+": this.getMinutes(),
            "s+": this.getSeconds(),
            "q+": Math.floor((this.getMonth() + 3) / 3),
    ...
    
  4. pattern(fmt)
    Date.prototype.pattern=function(fmt) {        
        var o = {        
        "M+" : this.getMonth()+1, 
        "d+" : this.getDate(), 
        "h+" : this.getHours()%12 == 0 ? 12 : this.getHours()%12, 
        "H+" : this.getHours(), 
        "m+" : this.getMinutes(), 
        "s+" : this.getSeconds(), 
        "q+" : Math.floor((this.getMonth()+3)/3), 
    ...
    
  5. pattern(fmt)
    Date.prototype.pattern=function(fmt) {         
        var o = {         
        "M+" : this.getMonth()+1, 
        "d+" : this.getDate(), 
        "h+" : this.getHours()%12 == 0 ? 12 : this.getHours()%12, 
        "H+" : this.getHours(), 
        "m+" : this.getMinutes(), 
        "s+" : this.getSeconds(), 
        "q+" : Math.floor((this.getMonth()+3)/3), 
    ...
    
  6. shortFormat()
    Date.prototype.shortFormat = function() {
      return (this.getMonth() + 1) + "/" + this.getDate() + "/" + this.getFullYear();
    
  7. simpleFormat()
    Date.prototype.simpleFormat = function()
        var d=this;
        return (""+d.getFullYear()+"-"+("00" + (d.getMonth() + 1)).slice(-2)) + "-" +
            ("00" + d.getDate()).slice(-2);
    };
    
  8. simpleFormatWithMinutes()
    Date.prototype.simpleFormatWithMinutes = function()
        var d=this;
        return (""+d.getFullYear()+"-"+("00" + (d.getMonth() + 1)).slice(-2)) + "-" +
            ("00" + d.getDate()).slice(-2)  +" "+
            ("00" + d.getHours()).slice(-2) + ":" +
            ("00" + d.getMinutes()).slice(-2)
    };
    Array.prototype.contains = function(obj) {
    ...
    
  9. simpleDateString()
    Date.prototype.simpleDateString = function() {
        function pad(value)
            return ("0" + value).slice(-2);
        var dateString = this.getFullYear() + "-" +
                pad(this.getMonth() + 1, 2) + '-' +
                pad(this.getDate(), 2);
        return dateString;
    ...