Javascript: convert seconds to a date object

function toDateTime(secs) {
    var t = new Date(1970, 0, 1); // Epoch
    t.setSeconds(secs);
    return t;
}

Comments

Popular posts from this blog

Cách khắc phục lỗi NodeJS chạy quá ngốn Ram trên Visual Studio 2017

Javascript: Calcuate MD5 hash of a large file

Razor: Convert Dictionary from Server to Javascript Dictionary