Task: Change the date format. What we have: Sparsili date at the moment js

var data2 = moment("8 декабря, 2017", "D MMM, YYYY"); 

The question is how to get the date of the next type 12/12/2017? You can of course pervert and subtract days, months and weeks separately, but you want a more adequate solution. THX

    1 answer 1

     var string = data2.format("DD.MM.YY"); 

    Returns the string of the desired format

     string === '08.12.17' 
    • Accept the answer so that no question hangs like it is not solved :) - gil9red