Nodejs Hour Get getSimpleHoursgetSimpleHours()

Here you can find the source of getSimpleHoursgetSimpleHours()

Method Source Code

Date.prototype.getSimpleHours = function getSimpleHours() {
  var ss_ofs = this.getDaySimpleSeconds();
  var sm_ofs = Math.floor(ss_ofs/100);
  var sh_ofs = Math.floor(sm_ofs/100);
  
  return sh_ofs;/*from w w w.j  av a 2s  .  c  om*/
}

Related

  1. getAMPMHour()
    Date.padded2 = function(hour) { padded2 = hour.toString(); if ((parseInt(hour) < 10) || (parseInt(hour) == null)) padded2="0" + padded2; return padded2; }
    Date.prototype.getAMPMHour = function() { hour=Date.padded2(this.getHours()); return (hour == null) ? 00 : (hour > 24 ? hour - 24 : hour ) }
    Date.prototype.getAMPM = function() { return (this.getHours() < 12) ? "" : ""; }
    Date.prototype.toFormattedString = function(include_time)
       str = this.getFullYear() + "." + Date.padded2(this.getMonth()+1) + "." + Date.padded2(this.getDate());
       if (include_time) { str += " " + this.getHours() + ":" + this.getPaddedMinutes() }
       return str;
    
  2. getBeautifulHour()
    Date.prototype.getBeautifulHour = function() {
      var hour = this.getHours(),
        minutes = this.getMinutes();
      hour = (hour < 10) ? '0' + hour : hour;
      minutes = (minutes < 10) ? '0' + minutes : minutes
      return hour + ':' + minutes;
    
  3. getHour()
    Date.prototype.getHour = function () {
        return (this.getHours() < 10 ? '0' : '') + this.getHours();
    };
    
  4. getHoursFormatted(number)
    Date.prototype.getHoursFormatted = function(number) {
        var hours = this.getHours();
        return hours < 10 ? '0' + hours : hours;
    };
    
  5. getHoursTwoDigits()
    Date.prototype.getHoursTwoDigits = function()
        var retval = this.getHours();
        if (retval < 10)
            return ("0" + retval.toString());
        else
            return retval.toString();
    };
    
  6. hourAgo()
    Date.prototype.hourAgo = function () {
      this.setHours(this.getHours() - 1);
      return this;
    
  7. millisPerHour()
    Date.millisPerHour = function(){ return 3600 * 1000 };
    Date.millisPerDay = function(){ return 24 * Date.millisPerHour() };
    Date.millisPerYear = function(){ return Date.millisPerDay() * 365 };
    Date.yearsFromNow = function(years){ return Date.fromMillis(Date.clone().getTime() + Date.millisPerYear() * years) };
    Date.hoursAgo = function(hours){ return Date.fromMillis(Date.clone().getTime() - Date.millisPerHour() * hours) };
    Date.daysAgo = function(days){ return Date.fromMillis(Date.clone().getTime() - Date.millisPerDay() * days) };
    Date.fromMillis = function(millis)
      return new Date(millis);
    ...
    
  8. minusHours(hrs)
    Date.prototype.minusHours = function(hrs) {
        this.setHours(this.getHours() - hrs);
        return this;
    };
    
  9. removeHours(h)
    Date.prototype.removeHours = function (h) {
      this.setHours(this.getHours()-h);
      return this;
    };