Home › JavaScript Tutorial › JS Temporal
JS Temporal
The modern date and time API.
Temporal replaces many problems of Date: time zones, immutability and calendars. Support is still arriving, so test for it.
Example code
<pre id='o'></pre>
<script>
if(typeof Temporal!=='undefined'){o.textContent=Temporal.Now.plainDateISO().add({days:10}).toString();}
else{o.textContent='Temporal is not available in this browser yet. Use Date for now.';}
</script>