Convert Number to Date - Node.js Date

Node.js examples for Date:Date Format

Description

Convert Number to Date

Demo Code

Date.prototype.parseStr = function( str ){

    var init = parseInt( str )
    var milliseconds = str % 1000;
    str /= 1000/*  w  w w.j  a v  a 2  s .  c o m*/
    var seconds = str % 100;
    str /= 100
    var minutes = str % 100;
    str /= 100
    var hours = str % 100;
    str /= 100;
    var day = str % 100;
    str /= 100;
    var month = str % 100;
    str /= 100;
    var year = str % 1000;
    str /= 10000;

    var d = new Date( year, month, day, hours, minutes, seconds, milliseconds )
    console.log( d.Format ( "YMDhmsx" ) );
    return d;
}

Related Tutorials