get the first and the last date of a week

Hi allI need to get the first and the last date of a specific week.I need a function that returns two date passing it just one date.The function has to calculate the first and the last date of the week of the argument date.hope to be clearregards
[288 byte] By [gionnyDeepa] at [2007-11-27 7:55:53]
# 1

goiters,

> I need to get the first and the last date of a specific week.

Yup, and what's the first day of the week in your part of the world, is it Sunday or Monday?

> I need a function that returns two date passing it just one date.

No you don't, just add 7 days to the start of the week.

> hope to be clear

Well, you can hope.

Keith.

Message was edited by: corlettk - now I hope to clear ;-)

corlettka at 2007-7-12 19:37:21 > top of Java-index,Java Essentials,Java Programming...
# 2
i mean that if i pass 15/06/2007 the function has to return me 10/06/2007 and 17/06/2007.The begin of the week and the end of the week.
gionnyDeepa at 2007-7-12 19:37:21 > top of Java-index,Java Essentials,Java Programming...
# 3
> i mean that if i pass 15/06/2007 the function has to return me 10/06/2007 and 17/06/2007.assuming you mean 10/6 and 16/6 (sun to sat)create a calendar object, set to 15/6/07.deduct the DAY_OF_WEEK from the date, add back 1 day = 10/6add 6 more days = 16/6
Michael_Dunna at 2007-7-12 19:37:21 > top of Java-index,Java Essentials,Java Programming...
# 4
no, i mean that i need the date of the first sunday before the actual date and the date of the first sunday after actual date.
gionnyDeepa at 2007-7-12 19:37:21 > top of Java-index,Java Essentials,Java Programming...
# 5
> no, i mean that i need the date of the first sunday before the actual date and > the date of the first sunday after actual date.changeadd 6 more days = 16/6toadd 7 more days = 17/6
Michael_Dunna at 2007-7-12 19:37:21 > top of Java-index,Java Essentials,Java Programming...
# 6
no.My actual date is dynamic ok?So for example i passed to my fucntion 15/06/2007 Firday.It has to return me Moday 11/06/2007 (start day of the week)and sunday 17/06/2007 (end day of week)
gionnyDeepa at 2007-7-12 19:37:21 > top of Java-index,Java Essentials,Java Programming...
# 7
> no.> My actual date is dynamic ok?> ...I'm pretty sure he understood that.Have a look at the Calendar class: http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.htmland re-read reply #3.Good luck.
prometheuzza at 2007-7-12 19:37:21 > top of Java-index,Java Essentials,Java Programming...