石墨消解仪后端用nodejs编写,与嵌入式端交互和前端交互均用ws
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
function generateSerialNumber() { const now = new Date(); const year = now.getFullYear(); //得到年份
const month = now.getMonth() + 1; //得到月份
const date = now.getDate(); //得到日期
const hour = now.getHours(); //得到小时数
const minute = now.getMinutes(); //得到分钟数
const second = now.getSeconds(); //得到秒数
const time = now.getTime(); return `${year}${month}${date}${hour}${minute}${second}${time}`; }
const res = generateSerialNumber(); console.log(res);
|