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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:54:16+00:00 2026-06-14T05:54:16+00:00

I am trying to list the next 10 weeks The result should be like

  • 0

I am trying to list the next 10 weeks

The result should be like this:

Week        Year
----------------
45:         2012  
46:         2012  
47:         2012  
48:         2012  
49:         2012  
50:         2012  
51:         2012  
52:         2012  
1:          2013  
2:          2013  

some years there is a week 53, and this year the 31st of December is on a Monday, is this week 1 or week 53??

Anyways, I want to skip week 53, whenever it occours. This means that 1 or 2 days will not be a part of any week on the list, but this doesn’t matter.

  • 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-14T05:54:19+00:00Added an answer on June 14, 2026 at 5:54 am

    i just wrote a small console app that does just that:

    static void Main(string[] args)
        {
            System.Globalization.CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentCulture;
            DateTime dt = DateTime.Now; //Use current date as starting point
            for (int i = 0; i < 10; i++)
            {
    
                int weekNo = ci.Calendar.GetWeekOfYear(
                dt,
                ci.DateTimeFormat.CalendarWeekRule,
                ci.DateTimeFormat.FirstDayOfWeek
                 );
                int year = ci.Calendar.GetYear(dt);
                if (weekNo == 53) //if week number==53, then go to next week
                {
                    dt = dt.AddDays(7);
                    weekNo = ci.Calendar.GetWeekOfYear(
                    dt,
                    ci.DateTimeFormat.CalendarWeekRule,
                    ci.DateTimeFormat.FirstDayOfWeek
                     );
                    year = ci.Calendar.GetYear(dt);
                }
    
                dt = dt.AddDays(7);
                Console.WriteLine(weekNo + "-" + year);
            }
        }  
    

    output today:

        46-2012
        47-2012
        48-2012
        49-2012
        50-2012
        51-2012
        52-2012
        1-2013
        2-2013
        3-2013
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to list the people who have birthday this week with this
I'm trying to list the contents of information_schema . TABLES like this: SELECT *
hey there guys and girls, iv been trying to fix this problem for weeks
Im trying to send a List to next activity the list List mGF =
I am trying to list all directories and place its number of files next
I've started a new job this week and am trying to get my head
Ok this is my problem. I am trying something like this: for i in
I'm trying to show a list of the next 20 days' events from a
trying to select next option drop down list by using a id identifier, but
I am trying to determine what the ID of the next list item to

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.