The modulus operator returns only the remainder of (seconds since
midnight) / 2.  I am not aware of any way to reverse the % operator
because:

6 % 1 = 0
6 % 2 = 0
6 % 3 = 0
6 % 6 = 0





David Ferguson <[EMAIL PROTECTED]>
Sent by: dotnet discussion <[EMAIL PROTECTED]>
05/24/2002 02:31 PM
Please respond to dotnet discussion


        To:     [EMAIL PROTECTED]
        cc:
        Subject:        [DOTNET] Fw: Why is build time wrong?


According to:

http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemReflectionAssemblyVersionAttributeClassctorTopic.asp

     build = days since January 1, 2000 local time
  revision = seconds since midnight local time, modulo 2

So why is the value of this program always one hour later than the
local time?

    using System;
    using System.Reflection;

    class App
    {
        public static void Main()
        {
            Assembly a = Assembly.GetExecutingAssembly();

            DateTime dt = new DateTime(2000, 1, 1);

            dt = dt.AddDays( a.GetName().Version.Build ).
                    AddSeconds( a.GetName().Version.Revision * 2 );

            Console.WriteLine( dt.ToString() );
        }
    }

Thanks...David

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to