lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r432280 - /incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/DateField.cs
Date Thu, 17 Aug 2006 16:20:30 GMT
Author: aroush
Date: Thu Aug 17 09:20:29 2006
New Revision: 432280

URL: http://svn.apache.org/viewvc?rev=432280&view=rev
Log: (empty)

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/DateField.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/DateField.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Document/DateField.cs?rev=432280&r1=432279&r2=432280&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/DateField.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Document/DateField.cs Thu Aug 17 09:20:29
2006
@@ -108,10 +108,15 @@
 		{
 			return SupportClass.Number.Parse(s, SupportClass.Number.MAX_RADIX);
 		}
+		
 		/// <summary>Converts a string-encoded date into a Date object. </summary>
 		public static System.DateTime StringToDate(System.String s)
 		{
-            return new System.DateTime(StringToTime(s));
+			long ticks = StringToTime(s) * TimeSpan.TicksPerMillisecond;
+			System.DateTime date = new System.DateTime(1970, 1, 1);
+			date = date.AddTicks(ticks);
+			date = date.Add(TimeZone.CurrentTimeZone.GetUtcOffset(date));
+			return date;
 		}
 	}
 }



Mime
View raw message