Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. function getSecondsToday () {
  2. var now = new Date();
  3.  
  4. var today = new Date(now.getFullYear(), now.getMonth(), now.getDay());
  5.  
  6. var diff = now - today;
  7.  
  8. var diff_sec = diff / 1000;
  9.  
  10. return diff_sec;
  11. }
  12.  
  13. alert(getSecondsToday());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement