Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 73117 invoked from network); 5 Sep 2007 00:12:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Sep 2007 00:12:13 -0000 Received: (qmail 17064 invoked by uid 500); 5 Sep 2007 00:12:08 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 17028 invoked by uid 500); 5 Sep 2007 00:12:07 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 17019 invoked by uid 99); 5 Sep 2007 00:12:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2007 17:12:07 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2007 00:13:18 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1ISiUf-0003hH-81 for dev@activemq.apache.org; Tue, 04 Sep 2007 17:11:41 -0700 Message-ID: <12489276.post@talk.nabble.com> Date: Tue, 4 Sep 2007 17:11:41 -0700 (PDT) From: semog To: dev@activemq.apache.org Subject: Re: ActiveMQ.Net: Client does not include timestamp when calculating expiration In-Reply-To: <12472360.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: e.semog@gmail.com References: <12277020.post@talk.nabble.com> <12412240.post@talk.nabble.com> <12472360.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org 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.