I apologize to the list for not being clear. When you view a problem from a 
certain perspective, you give what you think is clear and in this case it was not.

        What I wanted was given date: 12/1/01 and new date, say: 1/2/02, would give 1. 
If it had been 12/31/01, then zero.  Like I said after the post from Sisyphus, that I 
was after just whole integer months. I was looking at calculating epoch seconds and 
all this, but this seemed to be getting
more complicated that I needed. So just using integer arithmetic after verifying dates 
are good, you would have something of form: 1011201 and 1020102 which after doing 
calculation, would be 1. (calucation involves a simple routine to use year, month and 
day)

        Sorry for not being more specific(though unfortuantely I thought I was :( ).

Wags ;)
  
-----Original Message-----
From: Carl Jolley [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 02, 2001 11:50
To: Sisyphus
Cc: 'Perl Win32'
Subject: Re: Seeking Date routine to calculate number of whole Months
for two dates


On Sun, 2 Dec 2001, Sisyphus wrote:

> Seems to me that you would then first have to define what you mean by a
> 'whole month'.
>
> Consider the period 2000-01-07 (7th Jan.) to 2000-02-27 (27th Feb). Do you
> want that reported as zero whole months (because no full calendar month lies
> in that period), or 1 whole month (because more than 4 weeks has elapsed)?
>
> If it's the former, then, in the general case, it would be a matter of
> parsing the date and performing some simple arithmetic.  Subtract the
> earlier date's "month" number from the later date's "month" number and then
> subtract 1. Add this to the difference in years multiplied by 12. ( Hope
> that's right.) There may already be a wheel that does this - but it would
> probably be far quicker and easier to make your own, than it would be to
> find this wheel :-)
>
> If it's the latter then it really comes back to clarifying exactly what is
> meant by a 'whole month' - 4 weeks? - a twelfth of a year ? - 30 days ? -
> some mixture of calendar months and  a time period?.................
>

Or, since I don't seem to be hearing a coherent definition of what he
means by "whole months" perhaps he can give several different date pairs,
tell the "whole month" difference between them and explain why and then
we can see what he means by a "whole month" difference.

**** [EMAIL PROTECTED] <Carl Jolley>
**** All opinions are my own and not necessarily those of my employer ****

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to