• Post Reply Bookmark Topic Watch Topic
  • New Topic

week numbers differ between JDK's ?  RSS feed

 
Mikey Warren
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following code calculates a week number of 17 when run on "JDK 1.3.1", and 18 for "J2RE 1.4.2_03" on my PC -


Any ideas why that should be ?

thanks Mike
 
Mikey Warren
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A colleague has pointed out that

The javadoc warns you about setting a date and then changing the day of the week or something
like that.


So changing the order of the statements so that the setTime is is done last results in consistent results
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!