Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7958465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:25:38+00:00 2026-06-04T04:25:38+00:00

I have something like this in form : class EventForm(ModelForm): reg_due_date = forms.DateTimeField(input_formats=(‘%d/%m/%Y %H:%M’,),

  • 0

I have something like this in form :

class EventForm(ModelForm):
    reg_due_date = forms.DateTimeField(input_formats=('%d/%m/%Y %H:%M',), widget=forms.TextInput(attrs={ 'class': 'datePicker','readonly':'true'}))

and

class Event(models.Model):
    reg_due_date = models.DateTimeField()

Everything is ok, when I use jQuery DateTimePicker I have correct datetime format in the input field. But when I try to edit the form via this part of code I see seconds appearing and it is totally unacceptable. Where it comes from?

def editEventInfo(request,event_id):
    if request.method == 'GET':
        if event_id:
            event = Event.objects.get(pk=event_id)
            form = EventForm(instance=event) # An unbound form
        else:
            form = EventForm() # An unbound form
        return render_to_response('events/editEvent.html', {
            'form': form,
        },context_instance=RequestContext(request))
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:25:38+00:00Added an answer on June 4, 2026 at 4:25 am

    input_formats is the list of formats the form field will use to parse the input string into a date, what’s printed is driven by the format localization.

    you either need to activate USE_L10N = True or override DATETIME_FORMAT

    See https://docs.djangoproject.com/en/1.4/topics/i18n/formatting/ and https://docs.djangoproject.com/en/1.4/ref/settings/#datetime-format

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have something like this: forms.py: AVATAR_CHOICES = (('1','option1'), ('2','option2'), ('3','option3'), ('4','option4')) class RegistrationForm(forms.Form):
i have done something like this: <form action=validate.php method=get> Id :<input type=text name=pID/><br/><br/> Name
I have a simple html form that is structured something like this: <form name=test
I have an ASP.NET MVC form laid out something like this: @using (Html.BeginForm(null, null,
I have something like this set up: class CategoryPage (webapp.RequestHandler): def get(self): ** DO
I'd like to be able to have something like this: <form> <input type=date name=params.date/>
When we have something like this: interface ISomething<U,V> { ... } class Something<U,V> :
Lets say i have something like this: This is file tree.py: class leaf(): def
I have a code something like this: <div class=clearfix> <%= label_tag 'customer_email', 'Customer Email'
I have something like this in my project: add_custom_command(OUTPUT somefile) add_custom_target(tgt ALL DEPENDS somefile)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.