lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r925399 - /lucene/lucene.net/trunk/C#/src/Lucene.Net/Store/FSDirectory.cs
Date Fri, 19 Mar 2010 19:56:27 GMT
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}}
 		}
 		
 		/// <summary>Returns the time the named file was last modified. </summary>
 		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}}
 		}
 		
 		/// <summary>Set the modified time of an existing file to now. </summary>



Mime
View raw message