Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
Date and time:
<input type="datetime" id="myDatetime" min="2000-01-01T22:57Z" max="2014-02-06T22:57Z">
<p>Click the button to change the value of the min attribute of the datetime field.</p>
<button onclick="myFunction()">Try it</button>
<p><strong>Note:</strong> input elements with type="datetime" do not show as any datetime field/calendar in any of the major browsers, except Safari.</p>
<p id="demo"></p>
<script>
function myFunction() {
  var x = document.getElementById("myDatetime").min = "2010-01-01T21:57Z";
  document.getElementById("demo").innerHTML = "The value of the min attribute was changed from '2000-01-01T22:57Z' to '2010-01-01T21:57Z'.";
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_datetime_min2 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 05 Sep 2022 15:53:05 GMT -->
</html>