ajHurliman
ajHurliman

Reputation: 136

node.js What does Date#getTime() do?

I'm working on learnyounode module 13 right now. In the hints section it claims "Date#getTime() will also come in handy."

I looked up the Date object and found the getTime method, but what does it mean when there's a hash instead of a period?

Upvotes: 3

Views: 9755

Answers (2)

javed
javed

Reputation: 416

getTime function return unix timestamp

let nd = new Date();
let currentTime = nd.getTime();
console.log(currentTime);

Upvotes: 0

Boris Zagoruiko
Boris Zagoruiko

Reputation: 13174

This is just a refference to getTime method of Date object. It is normal syntax when you talk about documentations.

According to EcmaScript specification it returns this time value (the number of milliseconds since 1 January 1970 00:00:00 UTC.).

Upvotes: 7

Related Questions