Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
title version signature
Unix Timestamp (milliseconds)
1.0.0
moment().valueOf(); +moment();

moment#valueOf simply outputs the number of milliseconds since the Unix Epoch, just like Date#valueOf.

moment(1318874398806).valueOf(); // 1318874398806
+moment(1318874398806); // 1318874398806

To get a Unix timestamp (the number of seconds since the epoch) from a Moment, use moment#unix.

Note: ECMAScript calls this a "Time Value"