SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class GetCurrentDate {
  2.     constructor(_day, _month, _year) {
  3.         this.day = _day;
  4.         this.month = _month;
  5.         this.year = _year;
  6.     }
  7.  
  8.     display() {
  9.         // set date to the html element
  10.         document.getElementById('date_wg').innerHTML = `${this.day}/${this.month}/${this.year}`;
  11.     }
  12. }
  13.  
  14.  
  15. let today = new Date();
  16. let dd = String(today.getDate()).padStart(2, 0);
  17. let mm = String(today.getMonth() + 1).padStart(2, 0);
  18. let yyyy = today.getFullYear();
  19.  
  20.  
  21. currDate = new GetCurrentDate(dd, mm, yyyy);
  22. currDate.display();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top