﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20616	save date in one format in Python/Django	Raju	nobody	"forms.py

DATE_INPUT_FORMAT = (
    ('%d/%m/%Y','%m/%d/%Y')
)

class ReportDatetimeForm(forms.ModelForm):
    manual_date = forms.DateField(input_formats = DATE_INPUT_FORMAT,
                      widget=forms.DateInput(attrs={'size':'15','id':'datepicker','readonly':'readonly'}))
  
     class Meta:
        model = Report
        fields = ['manual_date']

This is my form to get the input as date with two different format.While giving input date in this format %m/%d/%Y' the date and month gets interchange while save in database.That affects in my application.So i want to save both input format in a single format namely yyyy-mm-dd,so what ever input format the user enter ,the given format should save in the above mentioned format.

I want to know how to write a custom function in forms.py to save the date in database in single format.

Thanks"	Uncategorized	closed	Python 2	1.3	Normal	invalid	django 1.3,python 2.7		Unreviewed	0	0	0	0	0	0
