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

  • SEARCH
  • Home
  • 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 8388625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:30:45+00:00 2026-06-09T18:30:45+00:00

I am working on a Django based Application, and i stuck in some place

  • 0

I am working on a Django based Application, and i stuck in some place where i want to save a time given by the user and the no of days (Monday-Sunday) in my database.

user will choose a time from Time picker widget or any other way, but it return into the 07 : 30 format.

User will also choose day’s from any picker or any other way (user can select multiple days), and it will save into the database.

I tried with the Django-Model field by putting :

timestamp = Models.DatetimeField()

and pass in Django-template using the Django model form, but it shows a text field (which doesn’t make any sense).

If, Anyhow it would be possible to get the time in 13:45 format and mon,tue,wed format, then i can also save it into CharField() in database.

I am not able to figure out the solution of above two situation. What are the best option to do it?

Should it be possible with the Java script? (but i am not professional in java script)

  • 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-09T18:30:46+00:00Added an answer on June 9, 2026 at 6:30 pm

    To use the widget, you should indicate in the form class for your model what the widget is:

    from django import forms
    
    class MyModelForm(forms.ModelForm):
        timestamp = forms.DateField(widget=forms.DateInput(attrs={'class':'timepicker'}))
    

    If you’re using the timestamp property in the model, it operates like a basic python datetime class, with many of the same attributes you would find there. If the format of the timestamp is what’s bothering you, you might look at filters that django has for displaying time and datetime fields: https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date

    I’m not certain why you would need to save the timesstamp in a specific format; django’s datetime field is pretty robust and easy to work with.

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

Sidebar

Related Questions

I'm working on a user based, social networking type of web application in Django.
The Django-based web application I'm working on is translated to a few different languages.
I've been working on my own django based blog (like everyone, I know) to
I'm working in Django, and using urllib2 and simplejson to parse some information from
I'm working on a django-nonrel project running on Google's AppEngine. I want to create
I am working to use django's ContentType framework to create some generic relations for
Background I'm working on an application which requires user-entered content, and I've decided to
I'm working on a simple CMS (based on Django, not that it matters) similar
I come from a java background, but I'm working on a django-based website. To
I'm working on my first web app (www.shopperspoll.com). It's a Django based facebook app

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.