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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:01:56+00:00 2026-05-13T11:01:56+00:00

Either I don’t understand the method getActualMaximum(int) or the field WEEK_OF_YEAR, or there’s a

  • 0

Either I don’t understand the method getActualMaximum(int) or the field WEEK_OF_YEAR, or there’s a Sun bug involved (or all three)…could someone explain to me why (at least in a German locale…) the following code:

    Locale.setDefault( Locale.GERMAN );
    Calendar c = Calendar.getInstance();
    c.set( Calendar.YEAR, 2010 );
    c.set( Calendar.MONTH, 0 );
    c.set( Calendar.DAY_OF_MONTH, 1 );
    System.out.println("max:    "+c.getActualMaximum( Calendar.WEEK_OF_YEAR ));
    System.out.println("actual: "+c.get( Calendar.WEEK_OF_YEAR ));

produces the following output:

    max:    52
    actual: 53

Here’s the Javadoc of getActualMaximum(int):

Returns the maximum value that the
specified calendar field could have,
given the time value of this Calendar.
For example, the actual maximum value
of the MONTH field is 12 in some
years, and 13 in other years in the
Hebrew calendar system.


Edit

The plot thickens. In an English locale (-Duser.language=en -Duser.country=us) the output is:

    max:    52
    actual: 1

Seems to point to it being a Sun bug for German locales?

  • 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-13T11:01:56+00:00Added an answer on May 13, 2026 at 11:01 am

    This information is correct:

    max:    52
    actual: 53
    

    The year 2010 has a maximum of 52 weeks. The actual week is 53, since 2009 has maximum 53 weeks and most weeks start on sunday or monday. Week 1 is in most cases the first week of the year with 4 days in january. Since the week of the january 1st has only 2 or 3 days in 2010, the week is considered part of 2009.

    Most likely the english locale has different rules for determing week 1, like the first week is the week of january 1st.

    Wikipedia explains it correctly: wikipedia week article

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

Sidebar

Related Questions

Either I don't understand the Instruments Leaks tool at all, or I am going
This is giving me headaches, AGAIN. I either don't understand this ajax response stuff
I've poked around on stackoverflow for a while, but either I don't understand templates
I've looked at several other SGen-related questions on here and either their answers don't
I don't know anything about either library but I have to choose one of
I don't see the point of using either http://960.gs or http://blueprintcss.org if they enforce
I'm either a bit overwhelmed by the complexity of NSDate or I simply don't
Is there a way to turn off all visual updates to a .NET form
I don't really need to disable them because I either disable the TabControl or
I've had a look at the other questions on json and either they don't

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.