Every line of 'node js timestamp' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
28 function timestamp () { 29 var t = Date.now() 30 var _t = t 31 if(_last == t) { 32 // while(_last == _t) 33 _t += ((_count++)/1000) 34 } 35 else _count = 1 36 37 _last = t 38 39 if(_t === LAST) 40 throw new Error('LAST:' + LAST + ',' + _t) 41 LAST = _t 42 return _t 43 }
73 function timestamp() { 74 return dateformat('yyyy-mm-dd HH:MM:ss (Z)') 75 }
9 get timestamp(){ 10 return `[${new Date().toLocaleString()}] `; 11 }
9 function timestamp(time) { 10 return dateBase(time).getTime(); 11 }
83 private timestamp() { 84 const today = new Date(); 85 return today.toISOString(); 86 }
73 private static get timestamp(): string { 74 const now = new Date(); 75 return `[${now.toISOString().replace(/T/, ' ').replace(/\..+/, '')}:${('00' + now.getUTCMilliseconds()).slice(-3)}]`; 76 }
26 function timestamp() { 27 var date = new Date(); 28 var YYYY = date.getUTCFullYear(); 29 var MM = kitx.pad2(date.getUTCMonth() + 1); 30 var DD = kitx.pad2(date.getUTCDate()); 31 var HH = kitx.pad2(date.getUTCHours()); 32 var mm = kitx.pad2(date.getUTCMinutes()); 33 var ss = kitx.pad2(date.getUTCSeconds()); 34 // 删除掉毫秒部分 35 return `${YYYY}-${MM}-${DD}T${HH}:${mm}:${ss}Z`; 36 }
62 function timestamp(str){ 63 return new Date(str).getTime(); 64 }
5 export function timestampNow() { 6 return Math.floor(+new Date() / 1000); // equal to timestampNow() 7 }
936 function getTimeStamp() { 937 return IS_IOS ? new Date().getTime() : performance.now(); 938 }