0
0
Postmantesting~10 mins

Timestamp generation in Postman - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to get the current timestamp in milliseconds.

Postman
var timestamp = [1]();
Drag options to blanks, or click blank then click option'
AtimeNow
BgetTime
Cnew Date
DDate.now
Attempts:
3 left
💡 Hint
Common Mistakes
Using new Date() without calling getTime() returns a Date object, not a timestamp.
Using a non-existent function like timeNow.
2fill in blank
medium

Complete the code to convert a Date object to a timestamp in milliseconds.

Postman
var timestamp = new Date().[1]();
Drag options to blanks, or click blank then click option'
AgetTime
Bnow
CtoISOString
DvalueOf
Attempts:
3 left
💡 Hint
Common Mistakes
Using now() on a Date instance causes an error.
Using toISOString() returns a string, not a timestamp.
3fill in blank
hard

Fix the error in the code to get the current timestamp in seconds.

Postman
var timestamp = Math.floor(Date.[1]() / 1000);
Drag options to blanks, or click blank then click option'
Anow
BtimeNow
CgetTime
DcurrentTime
Attempts:
3 left
💡 Hint
Common Mistakes
Using getTime() as a static method of Date causes an error.
Using non-existent functions like timeNow or currentTime.
4fill in blank
hard

Fill both blanks to create a timestamp string in ISO format and get its timestamp in milliseconds.

Postman
var isoString = new Date().[1]();
var timestamp = new Date(isoString).[2]();
Drag options to blanks, or click blank then click option'
AtoISOString
BgetTime
Cnow
DtoString
Attempts:
3 left
💡 Hint
Common Mistakes
Using now() instead of toISOString() for string conversion.
Using toString() returns a non-ISO string.
5fill in blank
hard

Fill all three blanks to create a UNIX timestamp in seconds from a Date object.

Postman
var date = new Date();
var milliseconds = date.[1]();
var seconds = Math.[2](milliseconds / [3]);
Drag options to blanks, or click blank then click option'
AgetTime
Bfloor
C1000
Dnow
Attempts:
3 left
💡 Hint
Common Mistakes
Using now() on Date instance causes error.
Using Math.round instead of Math.floor changes the result.
Dividing by 60 or 100 instead of 1000.