Search code examples
pythondjangolocale

Django: record creation problems when language changed


In the form I've date field in the MM/DD/YYYY format it works well when the language is set to english when another locale selected it becomes unable to create record in the database due to the incorrect date format error. The date is manually selected from the user interface.

Is there any issues on this problem, may be someone already faced such a problem?

Sultan


Solution

  • Before you insert your value into the database use "strftime".

    How to print date in a regular format in Python?