Guest User

Untitled

a guest
Oct 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. /**
  2. * Viết hàm diff trả về số ngày chênh lệch giữa 2 ngày bất kì
  3. */
  4. function diff(fromDate, toDate) {
  5. return toDate.getDate() - fromDate.getDate();
  6. }
  7.  
  8. var start = new Date('2018/05/17');
  9. var end = new Date();
  10.  
  11. console.log(diff(start, end));
Add Comment
Please, Sign In to add comment