MomentJS - As JavaScript Date


Advertisements

This method gives you the output same as the native JavaScript new Date().

Syntax

moment().toDate();

Example

var a = new Date();
var b = moment().toDate();

Output

As JavaScript Date
momentjs_formatting_date_and_time.htm
Advertisements