Fetching contributors…
Cannot retrieve contributors at this time
26 lines (18 sloc) 639 Bytes
title version signature
Unix Timestamp (seconds)

To create a moment from a Unix timestamp (seconds since the Unix Epoch), use moment.unix(Number).

var day = moment.unix(1318781876);

This is implemented as moment(timestamp * 1000), so partial seconds in the input timestamp are included.

var day = moment.unix(1318781876.721);

Note: Despite Unix timestamps being UTC-based, this function creates a moment object in local mode. If you need UTC, then subsequently call .utc(), as in:

var day = moment.unix(1318781876).utc();