Guest User

Untitled

a guest
May 21st, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. function generateHexTimeStamp() {
  2. let length = 8
  3. let currentSecond = Date.now()/1000;
  4. let timestamp = parseInt(currentSecond, 10) % 0xFFFFFFFF;
  5.  
  6. timestamp = timestamp.toString(16);
  7. return (timestamp.length===length)? timestamp : "00000000".substring(timestamp.length, length) + timestamp;
  8. }
Add Comment
Please, Sign In to add comment