Nodejs Date From fromOADate()

Here you can find the source of fromOADate()

Method Source Code

Number.prototype.fromOADate = function ()
{
   var jO = new Date(((this - 25569) * 86400000));
   var tz = jO.getTimezoneOffset();
   return new Date(((this - 25569 + (tz / (60 * 24))) * 86400000));

};

Related

  1. fromJSON(json)
    Date.fromJSON = function(json) {                                         
      try{        
        if (json.length == 10){
          parts = /^(\d{4})-(\d{2})-(\d{2})$/.exec(json);
          return new Date(Date.UTC(parts[1],parts[2]-1,parts[3],0,0,0));
        }else{
          parts = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).*Z$/.exec(json);
          return new Date(Date.UTC(parts[1],parts[2]-1,parts[3],parts[4],parts[5],parts[6]));
      catch(e){
        return null;    
    };
    
  2. fromYYYYMMDD(tmp)
    Date.fromYYYYMMDD = function(tmp) {
        return new Date( parseInt(tmp.substr(0, 4).replace(/^0+/, ""))
                                      , parseInt(tmp.substr(4, 2).replace(/^0+/, ""))-1
                                      , parseInt(tmp.substr(6, 2).replace(/^0+/, ""))
                                      );