Nodejs Date Get getSecondsTwoDigits()

Here you can find the source of getSecondsTwoDigits()

Method Source Code

Date.prototype.getSecondsTwoDigits = function()
{
    var retval = this.getSeconds();
    if (retval < 10)
    {// w w w .j a  va 2 s.c  o m
        return ("0" + retval.toString());
    }
    else
    {
        return retval.toString();
    }
};

Related

  1. 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);
    };
    
  2. getNextDate(i)
    Date.prototype.getNextDate = function(i){
      return new Date(new Date().setDate(new Date().getDate()+i));
    };
    
  3. getNumberDate()
    Date.prototype.getNumberDate = function() {
      var month = this.getMonth() + 1;
      var day = this.getDate();
      var year = this.getFullYear();  
      return month +"/"+ day +"/"+ year;
    
  4. getPreviousDate(i)
    Date.prototype.getPreviousDate = function(i){
      return new Date(new Date().setDate(new Date().getDate()-i));
    };
    
  5. getSecondsFormatted(number)
    Date.prototype.getSecondsFormatted = function(number) {
        var second = this.getSeconds();
        return second < 10 ? '0' + second : second;
    };
    
  6. getSimpleMillisecondsgetSimpleMilliseconds()
    Date.prototype.getSimpleMilliseconds = function getSimpleMilliseconds() {
      return (this.getDaySeconds()/ (24*60*60) * (10*100*100)) - this.getDaySimpleSeconds();
    
  7. getSimpleSecondsgetSimpleSeconds()
    Date.prototype.getSimpleSeconds = function getSimpleSeconds() {
      var ss_ofs = this.getDaySimpleSeconds();
      var sm_ofs = Math.floor(ss_ofs/100);
      var sh_ofs = Math.floor(sm_ofs/100);
      return ss_ofs - sm_ofs*100;
    
  8. getStDate(strDate)
    Date.prototype.getStDate=function(strDate) {
        var date = eval('new Date(' + strDate.replace(/\d+(?=-[^-]+$)/,
            function (a) { return parseInt(a, 10) - 1; }).match(/\d+/g) + ')');
        return date;
    };
    
  9. getSuffix()
    Date.prototype.getSuffix = function () {
        switch (this.getDate()) {
            case 1:
            case 21:
            case 31:
                return "st";
            case 2:
            case 22:
                return "nd";
    ...