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 366183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:36:30+00:00 2026-05-12T13:36:30+00:00

EDIT 2009-Nov-04 OK, so it’s been a little while since I first posted this

  • 0

EDIT 2009-Nov-04

OK, so it’s been a little while since I first posted this question. It seems to me that many of the initial responders failed to really get what I was saying–a common response was some variation on “What you’re saying doesn’t make any sense”–and so I’ve made some handy diagrams to really illustrate my point.

When we speak of numbers, we are generally referring to points on what grade school children learn is called the Number Line:

The number line

Now, when we learn arithmetic, our minds learn to perform a very interesting transformation of this concept. Evalutating the expression 1 + 0.5, for example, if we simply applied our “number line thinking”, would require us to somehow make sense of this:

Adding two points on the number line

It’s difficult to really illustrate that, because it’s difficult to think about that: “adding” two points. This is where a lot of responders struggled with the idea of adding dates (or simply dismissed it as absurd), because they were thinking of dates as points.

However, the expression 1 + 0.5 does make sense to us, because when we think of it, we’re really imagining this:

Adding a number (point) and a magnitude (vector)

That is, the number (or point) 1, plus the vector 0.5, resulting in point 1.5.

Alternately, we may be imagining this:

Adding two vectors

That is, the vector 1, plus the vector 0.5, resulting in the vector 1.5.

In other words, when dealing with numbers, we treat points and vectors interchangeably. But what about dates? Dates are, after all, basically numbers. If you don’t believe me, compare this line to the number line above:

A timeline

Notice the correspondence between the timeline and the number line? This was my point: if we perform the transformation above with numbers, we ought to be able to do it with dates as well. So, applying “timeline thinking”, the expression 0001-Jan-02 00:00:00 + 0001-Jan-01 12:00:00 doesn’t make a lot of sense, as plenty of responders pointed out:

Adding two points on a timeline

But, if we do the same conceptual transformation in our head that we perform every time we add or subtract numbers, we can easily “rethink” the above as this:

Adding a point in time and a time vector

So clearly, the difference between a DateTime and a TimeSpan is the same difference that exists between a point and a vector. What I think caused a lot of people to respond negatively to my suggestion is that it just feels so unnatural to think of dates as magnitudes in this way. But I don’t buy the argument that there’s no obvious reference point to use as zero. There is an obvious reference point, and I’ll give you a hint where it is: about 2010 years ago.

Don’t get me wrong: I’m not questioning the usefulness of drawing a conceptual divide between the notion of a DateTime and a TimeSpan. Really, my question all along should have been (as ChrisW indirectly suggested), why do we treat numbers and vectors interchangeably when dealing with regular numeric types? (Or: why do we have just one int type, instead of int and intspan?) There’s a big difference, and yet we don’t ever really think about it until sometime in junior high or high school, when we begin geometry. And then it’s treated as this new mathematical concept, when in reality it’s something we’ve been utilizing ever since we learned to add numbers by counting with our fingers.

In the end, the best answer came from Strilanc, who pointed out that the use of DateTime and TimeSpan is really an implementation of an affine space, which has the convenient property of not needing a reference point to treat as the origin. So thanks, Strilanc. I’m giving the accepted answer to ChrisW, however, for being the first one to bring up the concept of vectors and points, which really got to the crux of the matter.


ORIGINAL QUESTION (for posterity)

I am certainly no programming jack of all trades, but I know both PHP and .NET have a TimeSpan class in addition to a DateTime class (or structure in .NET), and I am guessing this is the case in a variety of other languages and frameworks as well (though I am writing this primarily with reference to the .NET structures). This might seem a strange question, but isn’t TimeSpan redundant?

In case you think the answer is obvious (“A DateTime is an absolute point in time, while a TimeSpan is a range of time — simple as that!”), consider this: an integer can be conceptualized as either an absolute value (the point on the number line) or a distance between values–and we don’t need two separate data types for these different conceptualizations. I can still write 5 + 6 without any ambiguity as to what I mean.

As long as there is a consistent zero-point reference, it seems to me there should be no reason why one would need a TimeSpan object to perform arithmetic operations on DateTime objects, or to get the distance between them.

What am I missing? Why can’t the unique methods and properties of the TimeSpan structure simply be folded into DateTime?

(Disclaimer: It isn’t like I’m passionate about this or anything; I’m fine using DateTime and TimeSpan objects as they’re intended all the time. I’m just asking a question.)

EDIT: Okay, over-simplified example to illustrate my point:

Consider the equation 10 – 5 = 5. One could read this as “Start at 10 (value), move 5 to the left (span), and you end up at 5 (value).”

Suppose, just to make things easy, we let January 1 1900 be point zero and we define TimeSpan objects in terms of days only.

Then 10 – 5 = 5 could be understood, in DateTime terms, as January 11 1900 – January 6 1900 = January 6 1900. This is fine, because January 11 is just “10” by our definition and January 6 is “5”. The fact that we are viewing the 10 as a value, the first 5 as a span, and the last 5 as a value again is merely for our own conceptual benefit. My point is just this: that the only difference is in how you think of the number, not in what it actually is. This is why we don’t have separate structures for, say, integer values and integer spans — a plain old integer covers all our bases.

Am I making any sense?

  • 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-05-12T13:36:31+00:00Added an answer on May 12, 2026 at 1:36 pm

    consider this: an integer can be conceptualized as either an absolute value (the point on the number line) or a distance between values

    By your logic, it isn’t TimeSpan that’s unecessary: rather it’s DateTime that’s unnecessary, and could be replaced by TimeSpan (duration since zero).

    Plus there’s the fact that integers have an obvious zero, whereas Dates however don’t have an obvious zero; but having an obvious zero is necessary, if you want to replace “place on the number line” with “distance/span from the zero/origin”.


    Edit:

    A point (location on a plane) isn’t the same as a vector.

    They seem similar …

    • A vector (distance from origin) can represent a point
    • A point (relative to the origin) can represent a vector

    … however the value of the vector that’s required to represent a given point will change if the origin changes.

    It always makes sense to add two (relative) vectors; but, it makes no sense to add two points, except by converting those points to vectors and then adding the vectors.

    The sum of two vectors is unaffected by a change in the origin, but the sum of two points would be affected by a change in the origin if you summed them by converting them to vectors and adding the vectors (because changing the origin would affect the values of those vectors).

    [Replace ‘point’ with DateTime and ‘vector’ with TimeSpan in the argument above.]

    I think there is a genuine difference between absolute and relative values. I’m don’t know why that difference isn’t more apparent in arithmetic, i.e. why ‘numbers’ are used seemingly interchangeably to represent both absolute and relative values.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Last Updated: 2009-08-11 2:30pm EDT A few days ago I posted this question about
I know this question has been asked before but it was in 2009 and
EDIT 07/14 As Bill Burgess mentionned in a comment of his answer, this question
EDIT : It turned out that this can only be done through an external
While my service executes, many classes will need to access User.Current (that is my
(A while back I read this great post: http://aaronlongwell.com/2009/06/the-ruby-on-rails-cms-dilemma.html , discussing the Rails CMS
In this exercise from O'Reilly's Head first Rails (ed. 2009) there are 2 related
Anyone knows how to create one? I know this question has been asked before
EDIT : Copied wrong part of function into this question, below is the appropriate
EDIT: I was an idiot. I simply had an image that was vertically long,

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.