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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:33:40+00:00 2026-05-28T03:33:40+00:00

How can I calculate the date of the next Friday?

  • 0

How can I calculate the date of the next Friday?

  • 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-28T03:33:40+00:00Added an answer on May 28, 2026 at 3:33 am

    A certain improvement on @taymon`s answer:

    today = datetime.date.today()
    friday = today + datetime.timedelta( (4-today.weekday()) % 7 )
    

    4 is Friday’s weekday (0 based, counting from Monday).
    ( (4-today.weekday()) % 7) is the number of days till next friday (% is always non-negative).

    After seeing @ubuntu’s answer, I should add two things:
    1. I’m not sure if Friday=4 is universally true. Some people start their week on Sunday.
    2. On Friday, this code returns the same day. To get the next, use (3-today.weekday())%7+1. Just the old x%n to ((x-1)%n)+1 conversion.

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

Sidebar

Related Questions

How can I calculate the date having only the week number and day of
How can I calculate year in a nullable date? partial void AgeAtDiagnosis_Compute(ref int result)
How can I calculate next dates using Java? For example, if the user gives
How can I calculate the next day from a string like 20110531 in the
How can I calculate yesterday as a date in JavaScript?
How can one calculate the seconds in a Excel serial date/time, linke in the
By using date object how we can calculate over lapping weeks? For eg: July
How can I calculate Next Business Day given a Zend_Date and a cutoff time
How can I calculate a date after a month of current date. Example if
How can I calculate time duration considering the datestamp in PHP? the date format

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.