Nodejs Date Get getFullDate(separator)

Here you can find the source of getFullDate(separator)

Method Source Code

Date.prototype.getFullDate = function(separator) {
    separator = separator ? separator : '-';
    return this.getFullYear()+separator+this.getMonthFormatted()+separator+this.getDayFormatted();
};

Related

  1. getFormat()
    Date.prototype.getFormat = function()
        return (this.getDate() < 10 ? '0' : '') + this.getDate() + '/' +
               (this.getMonth() < 10 ? '0' : '') + this.getMonth() + '/' +
               this.getFullYear() +
               ' | ' +
               (this.getHours() < 10 ? '0' : '') + this.getHours() + ':' +
               (this.getMinutes() < 10 ? '0' : '') + this.getMinutes() + ':' +
               (this.getSeconds() < 10 ? '0' : '') + this.getSeconds();
    ...
    
  2. getFormat()
    Date.prototype.getFormat = function()
        return (this.getDate() < 10 ? '0' : '') + this.getDate() + '/' +
               (this.getMonth() < 10 ? '0' : '') + this.getMonth() + '/' +
               this.getFullYear() +
               ' | ' +
               (this.getHours() < 10 ? '0' : '') + this.getHours() + ':' +
               (this.getMinutes() < 10 ? '0' : '') + this.getMinutes() + ':' +
               (this.getSeconds() < 10 ? '0' : '') + this.getSeconds();
    ...
    
  3. getFormated()
    Date.prototype.getFormated = function() {
      function pad(number) {
        if (number < 10) return '0' + number;
        return number;
      var d = this.getFullYear() + '-' + pad(this.getMonth() + 1) + '-' + pad(this.getDate());
      var t = pad(this.getHours()) + ':' + pad(this.getMinutes()) + ':' + pad(this.getSeconds());
      return d + ' ' + t;
    };
    ...
    
  4. getFromFormat(format)
    Date.prototype.getFromFormat = function(format) {
        var yyyy = this.getFullYear().toString();
        format = format.replace(/yyyy/g, yyyy)
        var mm = (this.getMonth()+1).toString(); 
        format = format.replace(/mm/g, (mm[1]?mm:"0"+mm[0]));
        var dd  = this.getDate().toString();
        format = format.replace(/dd/g, (dd[1]?dd:"0"+dd[0]));
        var hh = this.getHours().toString();
        format = format.replace(/hh/g, (hh[1]?hh:"0"+hh[0]));
    ...
    
  5. getFullDate()
    Date.prototype.getFullDate = function(){  
      if (this.getDate() < 10) {
        return '0' + this.getDate();
      return this.getDate();
    };
    
  6. getGMTOffset()
    Date.prototype.getGMTOffset = function () {
        return (this.getTimezoneOffset() > 0 ? "-" : "+")
            + String.leftPad(Math.floor(this.getTimezoneOffset() / 60), 2, "0")
            + String.leftPad(this.getTimezoneOffset() % 60, 2, "0");
    
  7. getLastDate()
    Date.prototype.getLastDate = function() {
        return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate();
    
  8. getLocalDateObject()
    Date.prototype.getLocalDateObject = function () {
        return new Date(this.toLocaleString())
    
  9. getMidnight()
    Date.getToday = function() {
       var now = new Date();
       return now.getMidnight();
    };
    Date.prototype.getMidnight = function() {
       return new Date( this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
    };