Gus de Boer
Gus de Boer

Reputation: 401

Angular date error

In AngularJS I'm trying to use the Date() function to get milliseconds from

'2014-11-19 10:58:16'

With this function

var n = new Date.parse('2014-11-19 10:58:16');

But I'm getting a weird error

TypeError: function parse() { [native code] } is not a constructor

How can I fix this?

Upvotes: 0

Views: 67

Answers (1)

Gus de Boer
Gus de Boer

Reputation: 401

As Frédéric Hamidi posted in the comment I shouldn't have used

new Date

but

Date

Thank you Frédéric Hamidi

Upvotes: 1

Related Questions