- MomentJS Tutorial
- MomentJS - Home
- MomentJS - Overview
- MomentJS - Environment Setup
- MomentJS - Introduction
- MomentJS - Parsing Date And Time
- MomentJS - Date Validation
- MomentJS - Getter/Setter
- Manipulate Date And Time
- Formatting Date And Time
- MomentJS - Date Queries
- MomentJS - Internationalization
- MomentJS - Customization
- MomentJS - Durations
- MomentJS - Utilities
- MomentJS - Plugins
- MomentJS - Examples
- MomentJS Useful Resources
- MomentJS - Quick Guide
- MomentJS - Useful Resources
- MomentJS - Discussion
MomentJS - Unix Timestamp
Using this, you can pass the integer value in milliseconds and seconds to moment.
Syntax
moment(Number);
Example
var day = moment(1315681876406);
Output
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
momentjs_parsing_date_and_time.htm
Advertisements