MomentJS - Unix Timestamp


Advertisements

Using this, you can pass the integer value in milliseconds and seconds to moment.

Syntax

moment(Number);

Example

var day = moment(1315681876406);

Output

Unix Timestamp

To use seconds inside moment will have to use it as moment.unix(timestamp)

Syntax

moment.unix(Number)

Example

var day = moment.unix(1968781876);

Output

moment.unix(timestamp)
momentjs_parsing_date_and_time.htm
Advertisements