Hallo Ernest,

I have discovered the bug. 
It was from tha java.uil.Date class. I have defined the dates using this class 
and the bug came from the second argument of the new  constructor  (year, 
month, day, hour, minutes). I thought I have defined the month August , but it 
was September (new Date(year-1900, month, day, hour, minutes). Therefore, I 
have substract 1 from the argument representing the month and I have solved the 
problem.

Ana

--- On Fri, 9/3/10, Ernest Friedman-Hill <ejfr...@sandia.gov> wrote:

From: Ernest Friedman-Hill <ejfr...@sandia.gov>
Subject: Re: JESS: Difference between dates
To: "jess-users" <jess-users@sandia.gov>
Date: Friday, September 3, 2010, 2:08 PM

I don't know how this could be; if you have a time difference in milliseconds, 
and you divide it by 86400000, you have a time difference in days. The number 
of days in a month does not enter into it at all.

On Sep 3, 2010, at 6:05 AM, ANA TANASESCU wrote:

> Hallo again,
> 
> I have read on JessWiki about working with Dates and I have found a few 
> interesting functions. I need in my program to calculate the difference 
> between two dates (number of days). Therefore, I have converted the date in 
> milisecond, I have used the diff-time function 
> (http://www.jessrules.com/jesswiki/view?DiffTime) and converted the result in 
> days.
> First it seems to work, but if I use month like february it looks that this 
> function considers that all months have 30 days.
> I thought that after converting in miliseconds I could use this function like 
> datediff in ACCESS.
> What shall I do?
> 
> Best regards,
> Ana
> 
> 

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, Livermore, CA 94550
http://www.jessrules.com







--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
--------------------------------------------------------------------




      

Reply via email to