This post originated from an RSS feed registered with Java Buzz
by Paul Kilroy.
Original Post: Oracle's TO_DATE() v. Java's Calendar - WEEK_OF_YEAR
Feed Title: The Frustrated Programmer
Feed URL: http://liberty.phpwebhosting.com/404.html
Feed Description: The problems I encounter on a daily basis, blogged for posterity. All content will be original, contain poor grammar and a few mispellings.
I hit an interesting bug in java.util.GregorianCalendar today. I was writing some reporting code that needed to find the number of widgets sold for each week of the year. I found the current week of the year from Calendar using get(WEEK_OF_YEAR), then selected the sum of selected the sum of widgets sold where TO_DATE( sale_date, 'WW' ) = ?. The documentation for each week of year calculation is