function getNowFormatDatePath(date) {
var year = date.getFullYear();
var month = date.getMonth() + 1;
var strDate = date.getDate();
var hour = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
var milliseconds = date.getMilliseconds();
var num = '';
for (var i = 0; i < 3; i++) num += Math.floor(Math.random() * 10);
month = month > 9 ? month : '0' + month;
strDate = strDate > 9 ? strDate : '0' + strDate;
hour = hour > 9 ? hour : '0' + hour;
minutes = minutes > 9 ? minutes : '0' + minutes;
seconds = seconds > 9 ? seconds : '0' + seconds;
milliseconds =
milliseconds > 9
? milliseconds > 99
? milliseconds
: '0' + milliseconds
: '00' + milliseconds;
var currentdate =
'SN' +
year +
month +
strDate +
hour +
minutes +
seconds +
milliseconds +
num;
return currentdate;
}
console.log(getNowFormatDatePath(new Date()),'--->流水号生成')
console