(7/10)

Dates And Times — JavaScript typing lesson

Work with dates and times using JavaScript's Date object.

What you'll practice

Let's work with real dates and times! JavaScript has a special `Date` object to help us.

  • `new Date()` creates a new Date object with the current date and time.
  • You can get specific parts of the date and time, like `.getFullYear()` or `.getMonth()`.

Pro Access Required

This is a premium lesson. Upgrade to Pro to unlock this interactive exercise and continue your learning journey.

📜JavaScript

Dates And Times

0 WPM
0% Accuracy
0:00 Time elapsed
1
2
3
4
5
6
7
let now = new Date();↵
↵
console.log('the current date and time is');↵
console.log(now);↵
↵
console.log('just the year');↵
console.log(now.getFullYear());
0 / 148
Press This!
👇
`~
1!
2@
3#
4$
5%
6^
7&
8*
9(
0)
-_
=+
⌫
⇥
Q
W
E
R
T
Y
U
I
O
P
[{
]}
\|
⇪
A
S
D
F
G
H
J
K
L
;:
'"
↵
⇧
Z
X
C
V
B
N
M
,<
.>
/?
⇧
Thumb
Index
Middle
Ring
Pinky