1

I have searched around but google cannot quite understand what I am asking. It seems simple but I can't seem to nail it down in my head, I'm probably thinking about it too hard. I am comparing two datetimes:

if(datetimeX < datetimeY)

... if this is true would that mean that from the present moment datetimeX is farther in the past than datetimeY ? Or, if this is true, has a greater amount of time elapsed since the exact moment of datetimeY which though the if is true would acutally mean datetimeY is farther in the past ?

3

First, let us take time to be linear...

In all seriousness, thinking of it not as past or future but as points on a timeline (regardless of the location on that timeline of DateTime.now()) helps. The infinitely far left end of the timeline is the beginning of the universe, and time proceeds to the right.

datetimeA < dateTimeB

evaluates to true when datetimeA is earlier (further left) on the timeline than datetimeB. Note, though, that both datetimes could just as well be in the future: 2018-12-31 < 2019-01-01.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.