是代码:
var time = new Buffer('506BF1E3','hex');
time.toString() //'Pk??'
Run Code Online (Sandbox Code Playgroud)
0x506BF1E3 = 1349251555 unixtime;
如何获得“ 1349251555”表格time缓冲区?
小智 5
这个也可以解决问题。通过使用基数参数16调用parseInt将十六进制转换为int
var time = new Buffer('506BF1E3','hex');
console.log(parseInt(time.toString('hex'), 16));
Run Code Online (Sandbox Code Playgroud)