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 7034539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:11:54+00:00 2026-05-28T01:11:54+00:00

start_date = ’07_Nov_2011′ end_date = ’10_Jan_2012′ I want to print all the intermediate dates

  • 0
start_date = '07_Nov_2011'
end_date = '10_Jan_2012'

I want to print all the intermediate dates in the same format:

day_month_year

If I can somehow convert start_date to date type I can do this:

sdate+timedelta(1)).strftime('%d_%b_%Y')

How do I convert it? Or is there a better way to do this?

  • 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-05-28T01:11:54+00:00Added an answer on May 28, 2026 at 1:11 am

    You can use datetime.datetime.strptime(...) to do the conversion. Like this:

    >>> datetime.datetime.strptime('07_Nov_2011', '%d_%b_%Y').date()
    datetime.date(2011, 11, 7)
    

    You can print all the intermediate dates with something like this:

    >>> start_date = '07_Nov_2011'
    >>> end_date = '10_Jan_2012'
    >>> 
    >>> first = datetime.datetime.strptime(start_date, '%d_%b_%Y')
    >>> last = datetime.datetime.strptime(end_date, '%d_%b_%Y')
    >>> for i in xrange((last-first).days):
    ...     print (first+datetime.timedelta(i)).strftime('%d_%b_%Y')
    ... 
    07_Nov_2011
    08_Nov_2011
    09_Nov_2011
    10_Nov_2011
    11_Nov_2011
    
    etc.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two date entities, start_date and end_date and now I want to find
How can i use the END_DATE/START_DATE from the first sub select in the second
I have a start_date and end_date . I want to get the list of
I have a table that has a START_DATE and an END_DATE column. I want
I have a start_date and end_date fields in my model, I want to assign
id start_date end_date 1 2012-02-05 2012-03-10 2 2012-03-05 2012-03-25 3 2012-03-19 2012-03-27 4 2012-04-01
I have a table tbl_charge id hotel_id start_date end_date charge_per_day ( in $) 1
Let's say I have the following table: Employee name start_date end_date John 2009-10-10 2009-12-31
I have two columns in my db: start_date and end_date , which are both
I have a table of the sort: USER | PLAN | START_DATE | END_DATE

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.