activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r512739 - /activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Util/DateUtils.cs
Date Wed, 28 Feb 2007 12:54:47 GMT
Author: jstrachan
Date: Wed Feb 28 04:54:46 2007
New Revision: 512739

URL: http://svn.apache.org/viewvc?view=rev&rev=512739
Log:
fixed bug in datetime handling

Modified:
    activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Util/DateUtils.cs

Modified: activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Util/DateUtils.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Util/DateUtils.cs?view=diff&rev=512739&r1=512738&r2=512739
==============================================================================
--- activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Util/DateUtils.cs (original)
+++ activemq/activemq-dotnet/trunk/src/main/csharp/ActiveMQ/Util/DateUtils.cs Wed Feb 28 04:54:46
2007
@@ -30,10 +30,20 @@
         /// The start of the UNIX epoch
         /// </summary>
         public static readonly DateTime UNIX_EPOCH = new DateTime(1970, 1, 1, 0, 0, 0, 0);
+		
+		/// <summary>
+		/// Method ToJavaTime
+		/// </summary>
+		/// <param name="timeToLive">A  TimeSpan</param>
+		/// <returns>A  long</retutns>
+		public static long ToJavaTime(TimeSpan timeToLive)
+		{
+			return ToJavaTime(new DateTime(timeToLive.Ticks));
+		}
 
 	    public static long ToJavaTime(DateTime dateTime)
 		{
-			return dateTime.ToFileTime() + EPOCH_DIFF;
+			return dateTime.ToFileTime() - EPOCH_DIFF;
 		}
 
         public static DateTime ToDateTime(long dateTime)



Mime
View raw message