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 );
- Appending html with a django link in ajax
- Django EmailMessage reply_to object not passing through to headers
- How to have multiple types of users in separated tables?
- Django: customusate m2m inline or class Meta for through model
Source:stackexchange.com