Facebook
From Enes, 3 Years ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 139
  1. <script>
  2. d = new Date();
  3.  
  4. yr = d.getFullYear();
  5.  
  6. mo = two_characters((d.getMonth() + 1).toString());
  7.  
  8. dy = d.getHours();
  9.  
  10. s = yr + "|" + mo + "|" + dy;
  11.  
  12.  
  13.  
  14. document.write(s);
  15. document.title = s;
  16.  
  17.  
  18. function two_characters(String st) {
  19.    r = "";
  20.    if (st.toString().length == 1) {
  21.       r = "0" + st;
  22.    }
  23.    if (st.toString().length == 2) {
  24.       r = st;
  25.    }
  26.    return r;
  27. }
  28. </script>