Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Get WeekStart Date & End date by Week Number in java

 
Badari Nath
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need a class file for the code to get the WeekStart date and WeekEnd Date if the Week Number of the year is given.
Ratan
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ratan,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
Rupinder Bains
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for the Weekstart date and weekend date dont you need to use a package from the API?
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems like an interesting home work assignment.
Is the first week of the year the first week that has a date in the year or the first week that starts after the first day? So if Jan 1 is a Tuesday, does the first week start on the Sunday before or the Sunday after?
A good place to start would be to discover the first Sunday of the year. That is fairly easy to do using the Java API. Then you can work it out from there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic