🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › util › Date.html
Date (Java SE 11 & JDK 11 )
January 20, 2026 - A month is represented by an integer from 0 to 11; 0 is January, 1 is February, and so forth; thus 11 is December. A date (day of month) is represented by an integer from 1 to 31 in the usual manner. An hour is represented by an integer from 0 to 23. Thus, the hour from midnight to 1 a.m. is ...
🌐
Oracle
docs.oracle.com › en › java › javase › 26 › docs › api › java.base › java › util › Date.html
Date (Java SE 26 & JDK 26)
1 week ago - A month is represented by an integer ... thus 11 is December. A date (day of month) is represented by an integer from 1 to 31 in the usual manner. An hour is represented by an integer from 0 to 23. Thus, the hour from midnight to 1 a.m. is hour 0, and the hour from noon to 1 p.m. is hour 12.
Discussions

java - new Date() deprecated in open jdk 11? or no supported - Stack Overflow
I wrote below code to test this ... Localdate.now() it's returning 11. I updated the Dockerfile jdk initially it was jdk8 and now it's openjdk11. Can this be the reason I am getting different results? Is new Date() no longer supported in Java 11?... More on stackoverflow.com
🌐 stackoverflow.com
Should Swing be deprecated to force use of JavaFX?
"Deprecating Swing will force people to use JavaFX." Do people believe this? How long have they deprecated Date? We're still using it where I work, in a fairly new project. I don't see anything different happening with Swing. More on reddit.com
🌐 r/java
97
47
November 19, 2012
[deleted by user]
I haven't used Netbeans in a few years and completely forgot it became an Apache project. I'll have to check it out More on reddit.com
🌐 r/java
33
91
July 22, 2019
Ebean ORM - Java/Kotlin/JVM
I've been using Ebean as an ORM for a while and I really like it. Despite the very small community, it works really well. I really enjoy support for Partial Objects, mapping Enums and a slew of other properties. I thought it deserved some attention here. More on reddit.com
🌐 r/java
56
33
January 29, 2018
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › time › package-summary.html
java.time (Java SE 11 & JDK 11 )
October 20, 2025 - This stores a date-time like '2010-12-03T11:30+01:00'. This is sometimes found in XML messages and other forms of persistence, but contains less information than a full time-zone. Unless otherwise noted, passing a null argument to a constructor or method in any class or interface in this package ...
🌐
Andornot
blog.andornot.com › blog › java-11-date-parsing-locale-locale-locale
Java 11 date parsing? Locale, locale, locale. • Andornot Consulting
Long story short, a date like '2004-09-15 12:00:00 AM' produced by Inmagic ODBC from a DB/Textworks database could not be parsed. The parser choked on the string at "AM," even though my match pattern was correct: 'uuuu-MM-dd hh:mm:ss a'. Desperate ...
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › util › class-use › Date.html
Uses of Class java.util.Date (Java SE 11 & JDK 11 )
July 15, 2025 - Report a bug or suggest an enhancement For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › text › SimpleDateFormat.html
SimpleDateFormat (Java SE 11 & JDK 11 )
January 20, 2026 - It does this by adjusting dates to be within 80 years before and 20 years after the time the SimpleDateFormat instance is created. For example, using a pattern of "MM/dd/yy" and a SimpleDateFormat instance created on Jan 1, 1997, the string "01/11/12" would be interpreted as Jan 11, 2012 while ...
🌐
Tutorialspoint
tutorialspoint.com › java › java_date_time.htm
Java - Date and Time
import java.util.*; import java.text.*; ... above program would produce the following result − · 1818-11-11 Parses as Wed Nov 11 00:00:00 EST 1818 · You can sleep for any period of time from one millisecond up to the...
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › time › LocalDate.html
LocalDate (Java SE 11 & JDK 11 )
January 20, 2026 - For example, 2009-01-01 minus one day would result in 2008-12-31. This instance is immutable and unaffected by this method call. ... Queries this date using the specified query.
Find elsewhere
Top answer
1 of 2
6

java.util.Date and java.util.Calendar are not deprecated, and still work as they always have. However, how they work is difficult to use, which is why java.time classes are recommended instead.

What you are seeing is the difference between WEEK_OF_YEAR (which depends on the locale) and ALIGNED_WEEK_OF_YEAR (which is the same in all locales).

When setting or getting the WEEK_OF_MONTH or WEEK_OF_YEAR fields, Calendar must determine the first week of the month or year as a reference point. The first week of a month or year is defined as the earliest seven day period beginning on getFirstDayOfWeek() and containing at least getMinimalDaysInFirstWeek() days of that month or year. Weeks numbered ..., -1, 0 precede the first week; weeks numbered 2, 3,... follow it. Note that the normalized numbering returned by get() may be different. For example, a specific Calendar subclass may designate the week before week 1 of a year as week n of the previous year.


ALIGNED_WEEK_OF_YEAR represents concept of the count of weeks within the period of a year where the weeks are aligned to the start of the year. This field is typically used with ALIGNED_DAY_OF_WEEK_IN_YEAR.

For example, in a calendar systems with a seven day week, the first aligned-week-of-year starts on day-of-year 1, the second aligned-week starts on day-of-year 8, and so on. Thus, day-of-year values 1 to 7 are in aligned-week 1, while day-of-year values 8 to 14 are in aligned-week 2, and so on.


And for the locale difference:

// returns DayOfWeek.MONDAY
WeekFields.of(Locale.forLanguageTag("de-DE")).getFirstDayOfWeek();

// returns DayOfWeek.SUNDAY
WeekFields.of(Locale.forLanguageTag("en-ZA")).getFirstDayOfWeek();

To get the unaligned week of year using the current system local with java.time:

LocalDate.now().get(WeekFields.of(Locale.getDefault()).weekOfYear())

If you want to be locale-independent, then there is ISO.weekOfYear() if you want the week to start on a Monday, and SUNDAY_START.weekOfYear() for a Sunday.

2 of 2
0

The old, much-derided Date and Calendar classes have always been confusing and difficult to use properly, particularly in a multi-threaded context.Java 8’s JSR 310 implementation offers specific classes for:

The old date library included only a single time representation class – java.util.Date, which despite its name, is actually a timestamp. It only stores the number of milliseconds elapsed since the Unix epoch.

🌐
W3Schools
w3schools.com › java › java_date.asp
Java Date and Time
Java Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Server Java Syllabus Java Study Plan Java Interview Q&A Java Certificate ... Java does not have a built-in Date class, but we can import the java.time package to work with the date and time API.
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › text › DateFormat.html
DateFormat (Java SE 11 & JDK 11 )
January 20, 2026 - Useful constant for one-based HOUR field alignment. Used in FieldPosition of date/time formatting. HOUR1_FIELD is used for the one-based 12-hour clock. For example, 11:30 PM + 1 hour results in 12:30 AM.
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › time › chrono › package-summary.html
java.time.chrono (Java SE 11 & JDK 11 )
January 20, 2026 - // Print the Thai Buddhist date ...eld.MONTH_OF_YEAR); int year = now1.get(ChronoField.YEAR); System.out.printf(" Today is %s %s %d-%s-%d%n", now1.getChronology().getId(), dow, day, month, year); // Print today's date and the last day of the year for the Thai Buddhist ...
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › time › YearMonth.html
YearMonth (Java SE 11 & JDK 11 )
July 15, 2025 - YearMonth is an immutable date-time object that represents the combination of a year and month. Any field that can be derived from a year and month, such as quarter-of-year, can be obtained. This class does not store or represent a day, time or time-zone. For example, the value "October 2007" can ...
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › util › Date.html
Date (Java Platform SE 8 )
1 week ago - A month is represented by an integer ... thus 11 is December. A date (day of month) is represented by an integer from 1 to 31 in the usual manner. An hour is represented by an integer from 0 to 23. Thus, the hour from midnight to 1 a.m. is hour 0, and the hour from noon to 1 p.m. is hour 12.
🌐
Oracle
docs.oracle.com › en › java › javase › 21 › docs › api › java.base › java › util › Date.html
Date (Java SE 21 & JDK 21) - Oracle
January 20, 2026 - A month is represented by an integer ... thus 11 is December. A date (day of month) is represented by an integer from 1 to 31 in the usual manner. An hour is represented by an integer from 0 to 23. Thus, the hour from midnight to 1 a.m. is hour 0, and the hour from noon to 1 p.m. is hour 12.
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › util › Date.html
Date (Java SE 17 & JDK 17)
January 20, 2026 - A month is represented by an integer ... thus 11 is December. A date (day of month) is represented by an integer from 1 to 31 in the usual manner. An hour is represented by an integer from 0 to 23. Thus, the hour from midnight to 1 a.m. is hour 0, and the hour from noon to 1 p.m. is hour 12.
🌐
Mpg
resources.mpi-inf.mpg.de › d5 › teaching › ss05 › is05 › javadoc › java › util › Date.html
Date
A month is represented by an integer from 0 to 11; 0 is January, 1 is February, and so forth; thus 11 is December. A date (day of month) is represented by an integer from 1 to 31 in the usual manner. An hour is represented by an integer from 0 to 23. Thus, the hour from midnight to 1 a.m. is ...
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › time › Year.html
Year (Java SE 11 & JDK 11 )
January 20, 2026 - Note that years in the ISO chronology ... caution. This class does not store or represent a month, day, time or time-zone. For example, the value "2007" can be stored in a Year....