javascript

Lodash - Get current timestamp in milliseconds

The Lodash now() function can be used to get the current timestamp. It returns the timestamp in milliseconds. See the below code examples to understand.

const timestamp = _.now();

console.log(timestamp);

Output

1649690293230

Try it yourself

_.now() function

The _.now() function is an in-built function of Lodash Library and it is mainly used to get the current timestamp. The Lodash library is used to manipulate data in the form of arrays or objects.

Was this helpful?