Return-Path: Delivered-To: apmail-lucene-lucene-net-commits-archive@www.apache.org Received: (qmail 2581 invoked from network); 19 Mar 2010 19:56:49 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 19 Mar 2010 19:56:49 -0000 Received: (qmail 47160 invoked by uid 500); 19 Mar 2010 19:56:49 -0000 Delivered-To: apmail-lucene-lucene-net-commits-archive@lucene.apache.org Received: (qmail 46781 invoked by uid 500); 19 Mar 2010 19:56:49 -0000 Mailing-List: contact lucene-net-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucene.apache.org Delivered-To: mailing list lucene-net-commits@lucene.apache.org Received: (qmail 46464 invoked by uid 99); 19 Mar 2010 19:56:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Mar 2010 19:56:48 +0000 X-ASF-Spam-Status: No, hits=-1015.4 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Mar 2010 19:56:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 28B42238896F; Fri, 19 Mar 2010 19:56:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r925399 - /lucene/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs Date: Fri, 19 Mar 2010 19:56:27 -0000 To: lucene-net-commits@lucene.apache.org From: digy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100319195627.28B42238896F@eris.apache.org> Author: digy Date: Fri Mar 19 19:56:26 2010 New Revision: 925399 URL: http://svn.apache.org/viewvc?rev=925399&view=rev Log: LUCENENET-353 IndexReader.LastModified giving invalid date? Modified: lucene/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs Modified: lucene/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs URL: http://svn.apache.org/viewvc/lucene/lucene.net/trunk/C%23/src/Lucene.Net/Store/FSDirectory.cs?rev=925399&r1=925398&r2=925399&view=diff ============================================================================== --- lucene/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs (original) +++ lucene/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs Fri Mar 19 19:56:26 2010 @@ -736,14 +736,14 @@ namespace Lucene.Net.Store { EnsureOpen(); System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name)); - return file.LastWriteTime.Millisecond; + return (long)file.LastWriteTime.ToUniversalTime().Subtract(new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds; //{{LUCENENET-353}} } /// Returns the time the named file was last modified. public static long FileModified(System.IO.FileInfo directory, System.String name) { System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name)); - return file.LastWriteTime.Millisecond; + return (long)file.LastWriteTime.ToUniversalTime().Subtract(new DateTime(1970, 1, 1, 0, 0, 0)).TotalMilliseconds; //{{LUCENENET-353}} } /// Set the modified time of an existing file to now.