Nodejs Time Convert changeToSeconds()

Here you can find the source of changeToSeconds()

Method Source Code

Number.prototype.changeToSeconds=function(){

      var ms=this;
      his=ms.getHisByMs();/*w  ww  .ja  va  2 s . c om*/
      var h=parseInt(his[0])*60*60;
      var m=parseInt(his[1])*60;
      var s=parseInt(his[2]);
      var second=h+m+s;
      return second;
}

Related

  1. day()
    Number.prototype.day = Number.prototype.days = function() {
      return (this * 3600 * 24 * 1000);
    };
    
  2. days()
    Number.prototype.days = function () {
      var i = this.valueOf();
      var t = new Date(1000 * 60 * 60 * 24 * i);
      return new Date(t).getTime();
    };
    
  3. days_after(cb)
    Number.prototype.days_after = function(cb){
      setTimeout(cb, this*1000);
    };
    var i=5;
    i.days_after(function(){
      console.log('test');
    });
    
  4. getWeek()
    Number.prototype.getWeek=function(){
        var weekDayList=["?","?","?","?","?","?","?"] ;
        var date=new Date(this.dateFormat());
        var weekDay=weekDayList[date.getDay()];
        return weekDay;