date and time in JavaScript

The Date object is used to work with dates and times. The Date object is created by using new keyword, i.e. new Date(). The Date object can be used date and time in terms of millisecond precision within 100 million days before or after 1/1/1970.
```
var t = new Date();  
document.write(t);
```
Output:
```
Wed May 25 2022 09:58:29 GMT-0400
```