Hi there,
I'm trying to build a function that can calculate, for a period until
5 months, the specified date.
For example, if i select today's date, 2nd October, the function must
return the following dates:
November 6
December 4
January 1
february 5
I've check and in some month the date, is days, distance is 28 but in
others it is 35. What happens for this number variation? I've analyzed
the number of weeks in a month, the start and end weekday of the month
and the number of days in the month but i can't seem to discover what
happens to be 35 or 28.
Any help will be usefull.
Thanks in advance.
Regards
Hunter Gratzner - 02 Oct 2007 18:55 GMT
> I'm trying to build a function that can calculate, for a period until
> 5 months, the specified date.
[quoted text clipped - 11 lines]
> and the number of days in the month but i can't seem to discover what
> happens to be 35 or 28.
Would you have spent five seconds and looked at a real calendar (one
people hang up at the wall), you would have recognized that the date
is in some way "rounded" to the same day of week. The dates are all
Tuesdays. I'll leave it up to you to figure out if the "rounding" is
up, down, nearest or whatever, and if the calculation is always done
from the start date, or each next calculated date serves as a fresh
starting point. It's your homework, not ours.
Roedy Green - 03 Oct 2007 01:56 GMT
>I'm trying to build a function that can calculate, for a period until
>5 months, the specified date.
[quoted text clipped - 5 lines]
>January 1
>february 5
this is the sort of thing BigDate does in its sleep. It is bundled
part of http://mindprod.com/products1.html#COMMON11
Look at the TestDate method which shows dozens of applications.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Dr J R Stockton - 03 Oct 2007 13:45 GMT
In comp.lang.java.programmer message <1191345166.023670.315510@o80g2000h
se.googlegroups.com>, Tue, 2 Oct 2007 10:12:46, Pedro Pinto
<kubic62@gmail.com> posted:
>I'm trying to build a function that can calculate, for a period until
>5 months, the specified date.
The N'th X-day of the month is always the nearest X-day to the (7*N-3)th
day of the month.
The N'th X-day of the month always lies in the inclusive range from the
(7*N-6)th to the (7*N)th of the month.

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.