[Fixed]-Formatting job returned from input with Jquery

1👍

In Django you can define the date input format, so it´s able to convert it into a datetime.date. You can do so by specifying

input_formats=['%Y-%m-%d']

in your DateField, if you are using a Django Form. Here’s the documentation: https://docs.djangoproject.com/en/1.10/ref/forms/fields/#datefield

Also, if you’re not using a Form, you can parse the date using

datetime.strptime(your_date, '%Y-%m-%d').date()

0👍

I hope this will work for you :

var d = new Date();

var curr_date = d.getDate();

var curr_month = d.getMonth();

var curr_year = d.getFullYear();

var date=new date(curr_year  + "-" + curr_month + "-" + curr_date );

Leave a comment