-5

I have a date as a String like : 2015-12 for december 2015.

I would like to convert this date to get this date in milliseconds in javascript. (From the first day of the month)

How can i do it ?

wawanopoulos
  • 9,614
  • 31
  • 111
  • 166
  • 1
    Well, you got the javascript part right. Next step is to write some ;) – Sterling Archer Feb 02 '16 at 19:48
  • 6
    [Here's a google search using your own words, by the way](https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=convert%20this%20date%20to%20get%20this%20date%20in%20milliseconds%20in%20javascript) – Sterling Archer Feb 02 '16 at 19:49

2 Answers2

-3

Try using the Date object (new Date()).

timtim17
  • 297
  • 4
  • 14
-3

You could do :

YourDate + "-01"

And then try to convert to a date

d = new Date(YourDate)

And finaly :

d.getMilliseconds()
Le Woogush
  • 375
  • 2
  • 16