Nodejs Time Calculate getTimeShift()

Here you can find the source of getTimeShift()

Method Source Code

Date.prototype.getTimeShift = function() {
    return this.getTimezoneOffset() < this.stdTimezoneOffset()?3:2;
};

Related

  1. getFullDateTime()
    Date.prototype.getFullDateTime = function() {
        return this.getFullYear()+'-'+this.getMonthFormatted()+'-'+this.getDayFormatted()+' '+this.getHoursFormatted()+':'+this.getMinutesFormatted()+':'+this.getSecondsFormatted();
    
  2. getNumberTime()
    Date.prototype.getNumberTime = function() {
      var hour = this.getHours();  
      if (this.getMinutes().length == 1)
        var min = "0" + this.getMinutes();
      else{var min = this.getMinutes();}
      var secs = this.getSeconds();  
      return hour +":"+ min +":"+ secs;
    
  3. getPrettyDateTime()
    Date.prototype.getPrettyDateTime = function () {
      var month = this.getMonth() + 1;
      var day = (this.getDate() < 10) ? "0" + this.getDate() : this.getDate();
      return month + "/" + day + "/" + this.getFullYear() + " " + this.getPrettyTime();
    };
    
  4. getPrettyTime()
    Date.prototype.getPrettyTime = function () {
      var minutes = (this.getMinutes() < 10) ? "0" + this.getMinutes() : this.getMinutes();
      var hours = this.getHours();
      var ampm = "AM";
      if (hours > 12) {
        ampm = "PM";
        hours -= 12;
      } else if (hours == 12) {
        ampm = "PM";
    ...
    
  5. getTimeAmPm()
    Date.prototype.getTimeAmPm = function () {
      let hours = this.getHours();
      let minutes = this.getMinutes();
      let ampm = hours >= 12 ? 'pm' : 'am';
      hours = hours % 12;
      hours = hours ? hours : 12; 
      minutes = minutes < 10 ? '0' + minutes : minutes;
      let strTime = hours + ':' + minutes + '' + ampm;
      return strTime;
    ...
    
  6. getUnixTime()
    getQueryString = function (field, url) {
        var href = url || window.location.href;
        var reg = new RegExp('[?&]' + field + '=([^&#]*)', 'i');
        var string = reg.exec(href);
        return string ? string[1] : null;
    };
    Date.prototype.getUnixTime = function () {
        return this.getTime() / 1000 | 0
    };
    ...
    
  7. halfHoursUntil(otherTime)
    Date.prototype.halfHoursUntil = function(otherTime) {
      var hour = new Date(this);
      var numberOfHalfHours = 0;
      while (hour < otherTime) {
        numberOfHalfHours++;
        hour.addHalfHour();
      return numberOfHalfHours;
    };
    ...
    
  8. onlyTime()
    Date.prototype.onlyTime = function () {
      return this.toTimeString().split(" ")[0];
    };
    
  9. p8DeDate(time)
    Date.prototype.p8DeDate = function(time) {
      var d = this;
      function pad(n) {
        return n < 10 ? '0' + n : n;
      function pad3(n) {
        if(n < 10) {
           return '00' + n;
        } else if(n < 100) {
    ...