Nodejs Utililty Methods String to Date Convert

List of utility methods to do String to Date Convert

Description

The list of methods to do String to Date Convert are organized into topic(s).

Method

getDateString()
Date.prototype.getDateString = function(){
  var S = this.getSeconds(),
      M = this.getMinutes(), H = this.getHours(),
      dd = this.getDate(), mm = this.getMonth()+1, 
      yyyy = this.getFullYear();
  if(dd<10){
    dd ='0'+dd
  if(mm<10) {
...
getDateString()
Date.prototype.getDateString = function () {
   return this.getFullYear() + '/' + this.getMonth2() + '/' + this.getDate2();
};
Date.prototype.addDays = function (days) {
    this.setDate(this.getDate() + days);
    return this;
};
Date.prototype.getDate2 = function () {
   var date = this.getDate();
...
getDateString()
Date.prototype.getDateString = function () {
   return this.getFullYear() + '/' + this.getMonth2() + '/' + this.getDate2();
};
getDateString(str)
Date.prototype.getDateString = function(str)
  var dnames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday',
      'Thursday', 'Friday', 'Saturday', 'Sunday'];
  var mnames = ['January', 'February', 'March', 'April',
      'May', 'June', 'July', 'August', 'September',
      'October', 'Novemeber', 'December'];
  str = str.replace('%day', dnames[this.getDay()]);
  str = str.replace('%date', this.getDate());
...