> Our client want us to check if for example the release_date is 9
> August 2007 is on the first week of the month. However it did not the
> referred to month but to release_date.
Have a look at the java.util.Calendar class. For example:
import java.io.*;
import java.util.Calendar;
public class CalendarExample {
public static void main (String argv[]) {
Calendar cal = Calendar.getInstance();
cal.set(2007, 8, 9); /* year, month, day */
System.out.println("Week of Month: " +
cal.get(Calendar.WEEK_OF_MONTH));
}
}
sherm--

Signature
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Lew - 13 Aug 2007 11:22 GMT
>> Our client want us to check if for example the release_date is 9
>> August 2007 is on the first week of the month. However it did not the
[quoted text clipped - 15 lines]
>
> }
Another approach, useful if you have to characterize dates more fully as, for
example, weekday vs. weekend, holidays (perhaps with separate logic for
holidays in different countries), "A" days vs. "B" days or other attributes
not known to java.util.Calendar, is to use a database table of dates. Each
date is tagged with the attributes of interest. Then all you have to do is
SELECT from that table to find out if a given date is a weekend, holiday or
whatever. It also supports queries like "how many non-holiday days are in an
interval, after the first four?"

Signature
Lew
In comp.lang.java.programmer message <1186977085.227438.92670@q3g2000prf
.googlegroups.com>, Sun, 12 Aug 2007 20:51:25, weetat
<weetat.yeo@gmail.com> posted:
> Our client want us to check if for example the release_date is 9
>August 2007 is on the first week of the month.
If that means in the first seven days, check that day-of-month is less
that 8.
Otherwise, you need to say what definition of week you are using -
International Standard, US vernacular, etc.

Signature
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6.
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.