Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>YYMMDD</title>
- </head>
- <body>
- <input id="ot1" value="170101" autofocus>
- <script>
- var date = new Date();
- var yy = ("" + date.getFullYear()).slice(-2);
- var mm = ("0" + (date.getMonth() + 1)).slice(-2);
- var dd = ("0" + date.getDate()).slice(-2);
- document.getElementById("ot1").value = yy + mm + dd;
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment