SOURCE

var str = '##0344QN=20240127084817050;ST=22;CN=2011;PW=123456;MN=B625-00E9;Flag=5;CP=&&DataTime=20240127084808;a01577-Rtd=36.7451,a01577-Flag=N;a01576-Rtd=119.11811,a01576-Flag=N;s01185-Rtd=274,s01185-Flag=N;s01184-Rtd=32,s01184-Flag=N;a34002-Rtd=199200.0,a34002-Flag=N;a34004-Rtd=150600.0,a34004-Flag=N;s01183-Rtd=15,s01183-Flag=N;s01182-Rtd=3,s01182-Flag=N;&&C741';
var sn = str.replace(/(.*?)MN=(\w+-*\w+).*/, '$2')
var time = str.replace(/(.*?)DataTime=(\d+).*/, '$2')
time = time.substring(0,4) + '-' + time.substring(4,6) + '-' + time.substring(6,8) + ' ' + time.substring(8,10) + ':' + time.substring(10,12) + ':' + time.substring(12,14)
var co = ''
if(str.indexOf("a01577") != -1){
    co = str.replace(/(.*?)a01577-Rtd=(.+?),.*/, '$2')
}
var timestamp = new Date('2024-01-31 00:21:11').getTime();
console.log(timestamp)
// var data = str.replace(/(.*?)DataTime=(\d+);(.*?);&&.*/, '$3');
// var mn = str.replace(/(.*?)MN=(\w+-*\w+).*/, '$2')
// var qn = str.replace(/(.*?)QN=(\w+-*\w+).*/, '$2')
// var dataset = data.split(';')
// // for(var i in dataset){
// //     var flag = dataset[i].replace(/(.*?)Flag=(\w+).*/, '$2')
// //     var parametercode = dataset[i].replace(/(\w+).*-Flag=(\w+).*/, '$1')
// //     var value = dataset[i].replace(/(.*?)=(.+?),.*/, '$2')
// //     console.log(value)
// // }

// // console.log(mn);
// var date = new Date('2024-01-30 01:02:00');
// date.setUTCMinutes(date.getUTCMinutes() - 8 * 60);
// // date.setUTCHours(date.getUTCHours() - 8);
// // date.setTime(date.getTime() - 8 * 60 * 60 * 1000);
// // date.setHours(date.getHours() - 8);
// var Year = date.getFullYear();
// var Moth = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
// var Day = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate())
// var Hour = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours())
// var Minute = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes())
// var Sechond = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds())
// date =  Year + '-' + Moth + '-' + Day + ' '+ Hour +':'+ Minute  + ':' + Sechond;
// console.log(date);
console 命令行工具 X clear

                    
>
console