# Insert different formated date in django

**URL:** <https://forum.djangoproject.com/t/insert-different-formated-date-in-django/31838>\
**Category:** Getting Started\
**Created:** [June 8, 2024, 7:58am UTC](https://forum.djangoproject.com/t/insert-different-formated-date-in-django/31838 "2024-06-08T07:58:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![afoysal](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/afoysal/32/20425_2.png) [@afoysal](https://forum.djangoproject.com/u/afoysal)\
**Post date:** [June 8, 2024, 7:58am UTC](https://forum.djangoproject.com/t/insert-different-formated-date-in-django/31838/1 "2024-06-08T07:58:44Z")

</div>

I have a Date input field in my form like below.

```auto
<label class="form-label">Date of Birth</label>
{{ form.date_of_birth }}  
{% if form.date_of_birth.errors %}
   <div class="alert alert-danger">{{ form.date_of_birth.errors }}</div>
{% endif %}

```

I am trying to insert date `08/06/2024`. I am getting error `Enter a valid date.`. I am using below code in `forms.py`.

```auto
date_of_birth = forms.DateField(
   required=True,
   input_formats=['%d/%m/%Y']  
)

```

I am using below code in `settings.py`.

```auto
DATE_INPUT_FORMATS = ['%d/%m/%Y']

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [June 9, 2024, 12:30am UTC](https://forum.djangoproject.com/t/insert-different-formated-date-in-django/31838/2 "2024-06-09T00:30:07Z")

</div>

This works for me based upon what you’re showing here. We may need to see the complete view, form, and template to be able to provide assistance.
