JSFiddle - React, Tailwind, and code Playground

by Rufuus06

HTML

<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Set()</title>
  </head>
  
  <body>
    
    <h2>Set():</h2>
    <p>Establece la fecha y hora que el usuario introduzca.</p>
    <p>setFullYear(): </p>
  
    <p id="exp"></p>
    
  </body>
  
</html>

JavaScript

var time = new Date();
time.setFullYear(2020, 11, 6);
document.getElementById("exp").innerHTML = time;