- 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 - Moment Clone
Moment Clone will create a copy of the moment created.
Syntax
moment(Moment);
There are 2 ways to clone a moment. Observe the following examples for a better understanding −
Example 1
var date1 = moment([2017,06,10]); var date2 = moment(date1);
Output
Example 2
var date1 = moment([2017,06,10]); var date2 = date1.clone();
Output
momentjs_parsing_date_and_time.htm
Advertisements