How does js convert seconds into dates?

  node.js, question

Now there is a situation: the backstage returned to me a number of seconds from January 1, 1970 to now, and then I need to convert the number of seconds to January 1, 1970. I think some methods are too complicated and troublesome. I want to ask you if you have any better methods or ideas.

Direct code

Date.prototype.Format = function (fmt) {
 var o = {
 "m plus": this.getMonth () plus 1, // month
 "d plus": this.getDate(), // day
 "h plus": this.getHours(), // hours
 "m plus": this.getMinutes(), // points
 "s plus": this.getSeconds(), // seconds
 "q plus": Math.floor((this.getMonth () plus 3)/3), // quarter
 "S": this.getMilliseconds() // ms.
 };
 If ((y plus)/.test (fmt)) fmt = fmt.replace (regexp. $1, (this.getfullear () plus ""). substr(4-RegExp.$1.length));
 for (var k in o)
 If (new RegExp ("("plus k plus ")"). test (fmt)) fmt = fmt.replace (regexp. $1, (regexp. $ 1.length = = 1)?  (o[k]): (("00 "plus o[k]).substr ((""plus o[k]).length));
 return fmt;
 bracket
 
 //call
 new Date(time).Format("yyyy-MM-dd hh:mm");