时间戳:
1395660658
代码:
//timestamp conversion
exports.getCurrentTimeFromStamp = function(timestamp) {
var d = new Date(timestamp);
timeStampCon = d.getDate() + '/' + (d.getMonth()) + '/' + d.getFullYear() + " " + d.getHours() + ':' + d.getMinutes();
return timeStampCon;
};
这会根据时间格式正确转换时间戳,但日期始终为:
17/0/1970
为什么 - 干杯?