Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8870199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:39:48+00:00 2026-06-14T17:39:48+00:00

I looked at DateTime Equals implementation : public bool Equals(DateTime value) { return (this.InternalTicks

  • 0

I looked at DateTime Equals implementation :

public bool Equals(DateTime value)
{
    return (this.InternalTicks == value.InternalTicks);
}

and then look at internalticks

internal long InternalTicks
{
    [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
    get
    {
        return (((long) this.dateData) & 0x3fffffffffffffffL);
    }
}

And then I noticed this number : 0x3fffffffffffffffL

which is : 4611686018427387903

But more interesting is its binary representation :

00111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
^^
||

Please notice the arrows

I could have understand if only the left arrow would have been 0 ( positive representation)

  • But why the second one is also 0 ?

  • Also , why would i every want it to be & with a 1111.... number ? if I want to display 5 I don’t have to do 5 & 1 , just 5.

Any help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:39:50+00:00Added an answer on June 14, 2026 at 5:39 pm

    You can get this kind of information from the Reference Source. The most relevant declarations in dd/ndp/clr/src/bcl/system/datetime.cs:

        private const UInt64 TicksMask             = 0x3FFFFFFFFFFFFFFF;
        private const UInt64 FlagsMask             = 0xC000000000000000;
        private const UInt64 LocalMask             = 0x8000000000000000;
        private const Int64 TicksCeiling           = 0x4000000000000000;
        private const UInt64 KindUnspecified       = 0x0000000000000000;
        private const UInt64 KindUtc               = 0x4000000000000000;
        private const UInt64 KindLocal             = 0x8000000000000000;
        private const UInt64 KindLocalAmbiguousDst = 0xC000000000000000;
        private const Int32 KindShift = 62;
    

    Note how the Kind values map to those two bits.

        public DateTime(long ticks, DateTimeKind kind) {
            // Error checking omitted
            //...
            this.dateData = ((UInt64)ticks | ((UInt64)kind << KindShift));
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I looked around and couldn't find it! Maybe I didn't look hard enough,but this
I looked around but haven't found an answer to this. I have a CentOS
I looked at this: Returning values from nested functions in Javascript but it did
I looked at this example http://msdn.microsoft.com/en-us/library/bb399420.aspx and clicked on DataContext.CreateDatabase which brought me to
How would I convert this from js to C#. I've looked but cant find
I am pulling my hair out with this one. I have looked and cannot
I have an edit object view. In this view are several DateTime? properties that
I looked at this answer and I am in a situation where I don't
I am going to have a datetime value in my admin module and I
I've looked at the MySQL 5.1 docs, and still can't figured this out --

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.