Every line of 'typescript 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.
73 function timestamp() { 74 return dateformat('yyyy-mm-dd HH:MM:ss (Z)') 75 }
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 }
9 get timestamp(){ 10 return `[${new Date().toLocaleString()}] `; 11 }
5 export function timestampNow() { 6 return Math.floor(+new Date() / 1000); // equal to timestampNow() 7 }
62 function timestamp(str){ 63 return new Date(str).getTime(); 64 }
83 private timestamp() { 84 const today = new Date(); 85 return today.toISOString(); 86 }
3 export function timestampToDate(timestamp?: pb.google.protobuf.ITimestamp) { 4 let millis: number 5 if (!timestamp) { 6 millis = 0 7 } else { 8 millis = timestamp.seconds as number * 1e3 + timestamp.nanos / 1e6 9 } 10 return new Date(millis) 11 }