activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From semog <e.se...@gmail.com>
Subject Re: ActiveMQ.Net: Client does not include timestamp when calculating expiration
Date Wed, 05 Sep 2007 00:11:41 GMT

Hi Stefan,

Thanks for your feedback.  I wouldn't change the epoch times, because that
may cause discrepancies if any code is added later to reference the
individual epochs. I am in the GMT-8 (sometimes GMT-7) timezone.  I am
surprised that the call fails, but have theories as to why it would fail and
the Utc version of the function would succeed.  Your suggested change to the
calculation of epochDiff is correct.  Converting both to Utc time before the
subtraction operation will produce the same results.  I'll incorporate your
change in to my code as well and include that in the patch that I will
submit, unless you report back there are still problems with it.

- Jim


StefanL wrote:
> 
> Hi Jim,
> 
> Thanks for your fix which I am about to use. Just a note on the type
> initializer in DateUtils,
>     static DateUtils() 
>     { 
>         epochDiff = (javaEpoch.ToFileTime() - windowsEpoch.ToFileTime()) 
> / TimeSpan.TicksPerMillisecond; 
>     } 
> 
> This fails here in GMT+1 land when the 'windowsEpoch.ToFileTime()' is
> called with ArgumentException.
> If I instead do 'new DateTime(1601, 1, 1, 1, 0, 0, 0).ToFileTime()' this
> gives 0/zero.
> Note the 1 hour specified to the DateTime ctor.
> 
> Anyway, I would suggest that the row would be 
> epochDiff = (javaEpoch.ToFileTimeUtc() - windowsEpoch.ToFileTimeUtc())  /
> TimeSpan.TicksPerMillisecond;
> 
> Which runs without exceptions, hopefully it runs correct also..
> Regards
>  Stefan
> 
> 

-- 
View this message in context: http://www.nabble.com/ActiveMQ.Net%3A-Client-does-not-include-timestamp-when-calculating-expiration-tf4312287s2354.html#a12489276
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Mime
View raw message