views:

204

answers:

14

I need to interpret relative date string like:

  • last Friday
  • this Tuesday
  • next Wednesday

The "Last Friday" form is easy (take the most recent Friday that is not today) but what about "this" vs. "next"? Could "this Wednesday" be yesterday on a Thursday? Could "this" and "next" Friday be the same day in some cases and a week apart in others?


p.s. Given that my target audience is American, I'm primarily interested in the US English vernacular use of the term and slightly less interested in other non-US English (for instance en-gb) usages so if you are non-US please say where you are from.


My current thinking:

  • Last X: the most recent X not including today.
  • This X: the immediate next X not including today.
  • Next X: the X in the next week (with the start of the week being a bit arbitrary).

Try it out here (be sure to check allow relative)

A: 

This tuesday is the next tuesday after today, so on a tuesday, the next tuesday is 1 week away

Similarly, "Next Wednesday" works the same way.

cdeszaq
so "this" and "next" are the same?
BCS
+4  A: 

Well I think you need to look at the question... if it says "When WILL you be doing X? then 'this Tuesday' obviously means the next Tuesday. If it says "When DID you do X? Then 'this Tuesday' means the previous Tuesday.

jle
Unfortunately, I will have no context.
BCS
With no context, you are kind of out of luck for that situation. The only thing you can do is approximate by making a rule such as taking the nearest Tuesday to the current date to mean 'this'... at that point, you are just guessing though.
jle
I disagree. I do not use "This" to refer to past days, ever. I used the words "This passed Tuesday", for example, but never simply "This".
That is exactly the point... people use it in different ways :)
jle
While it is true that people use these words in different ways, I believe the way you stated the use of "This" is uncommon. It is very true, however, that in real life you frequently need context in order to understand which day someone means.
+4  A: 

Last Friday = First Friday previous to today
Next Wednesday = First Wednesday after today*.

This Tuesday is a problem. It's a problem because people use it to mean different things. For some people it means the Tuesday of the current week, even if it is in the past. For others it means the next Tuesday after today.

Similarly some people use Next Wednesday to mean the Wednesday of the next week. In the south we often say "Wednesday Week" as a short form of "a week from Wednesday". You will see regional differences in how all of these terms are used (except perhaps for Last Friday).

The problem is that, we can all argue about the proper grammatical usage, and someone will be right. However that won't change the fact that people mean different things, often by region, in day to day usage. That will continue to be a problem for you.

Ideally you need a learning program. It will guess what they mean and propose an answer, which they can correct. Over time, you can "learn" your users, either in whole or in aggregate chunks (perhaps by region) and be more accurate in guessing the right interpretation of their language. It's likely that you'll never get beyond having to allow them the ability to manually override your determination somehow.

Russell Steen
I'm expecting the best I can do is get something that's gets it correct a lot and always gives something that's reasonable (a.k.a. no WTFs for anyone)
BCS
+1  A: 

"This Tuesday" would be the Tuesday in this week, unless it is Saturday. I have heard many people refer to "This Tuesday" as next week's Tuesday on Saturday.

"Next Wednesday" would probably be the next Wednesday that is not this week.

Ryan
+2  A: 

This refers to either: the current day, the next day of the week matching the name, or if we are passed said day the named day of the coming week. Whichever day you define the week on these rules will make sense if applied in the order listed.

Next (and this choice is somewhat arbitrary, but my personal choice) refers to the named day of the week after the current one.

If we define the week to end on Sunday, and it is Wednesday, the following would hold:

This Wednesday would be the current day.
Next Wednesday would be next week.

If we define the week to end on Sunday, and it is Tuesday, the following would hold:

This Wednesday would be the next day (the Wednesday of the current week).
Next Wednesday would be 8 days from now (the Wednesday of the next week).

If we define the week to end on Sunday, and it is Thursday, the following would hold:

This Wednesday would be the Wednesday of the coming week
Next Wednesday would be the Wednesday of the coming week

well put thought out +1
BCS
+3  A: 

Unfortunately, I consider both "last" and "next" to be ambiguous.

I believe that if it's Saturday that few people would call yesterday "last Friday". Likewise with next. On Sunday most people would call it "last Friday", though.

Next is even more ambiguous, when does it switch from being "next Friday" to "this Friday"??

If I were asked to code this I would put it into some sort of table so the users could tweak it.

Loren Pechtel
what would be your threshold? One day? One weekend day?
BCS
I always ask for an exact dates when people use these expressions as I'm pretending to write it down to make a note."So, that's the 16th, right?"
llamaoo7
@llamaoo7: that's actually one of the use cases: take the relative date, convert it to an absolute date, replace the original input and expect the user to change it if I got it wrong.
BCS
Unqualified days I think should always refer to either a day that happened at most 2 days ago. If you say Friday and it is Saturday, then Friday refers to the previous day. If you say Friday and it is Monday, then the meaning is ambiguous but I would generally think the coming Friday takes precedence.
+1 user customization
MrZombie
+7  A: 

I am located in US and in every day talk this is how we use those phrases:

  • "this Tuesday" refers to the Tuesday that will occur the soonest after the statement is said. not including today

  • "next Tuesday" refers to the Tuesday after this Tuesday.

Jacob Nelson
I use "This" (though rarely) to refer to the same day. Usually in a officious manner, as in "On this Tuesday, I blah blah blah". Think of it like your being very authoritative: "On this Tuesday, the 32413 day of the Mayan calendar, ..."
Your "next Wednesday" is the way "next Wednesday" is understood in German. If I say it with no emphasis on "next" I mean the immediate subsequent occurrence of it after today, but upon checking my usages, I find that if I emphasize "next" I mean what you mean! Yikes. BCS will not be able to detect speech emphasis in text, I'm afraid. Talk about intractable problems.
Cyberherbalist
To me, if the week has not "ended" in someone's mind next can refer to "this" Tuesday. See my post for longer clarification, but "next" in my mind always refers to the next day after the end of the week, defining the end of the week on Sunday usually. (Note that week ending varies by culture, in Mexico they think of the week ending Saturday and starting Sunday)
I'm in the US and I think this most closely matches how I have heard these terms used, but I must have missed the memo when I was growing up because I always found this to be ambigous. I often use 'this' or 'this coming' Tuesday, but instead of 'next' Tuesday I often say 'a week from' Tuesday or the Tuesday 'after next' and I hear other people use these terms as well.
Zack
+1  A: 

When some people say "See you next Friday", they really mean "See you Friday after next"/"See you Friday of next week". Others (including myself) would interpret it literally. I would add visual confirmation to eliminate confusion. Also, today is Wednesday. If someone came up to me and asked what I did last Tuesday, I would realize they could be talking either about yesterday or about 8 days ago.

I'm American, by the way.

Sean
+1  A: 

In my experience, in American English "this" always means the next immediate occurence of the day. If it is Monday, "this Wednesday" means the day after tomorrow. Typically, if it is Monday, "this Tuesday" is preferentially referred to as "tomorrow" -- I cannot remember anyone ever saying "this Tuesday" on a Monday, unless they thought it was currently Sunday.

If I say "next Wednesday" on a Wednesday, I mean a week from today. If I say "next Wednesday" on a Tuesday, however, I might mean a week from tomorrow, or I might mean tomorrow -- it would depend upon context and is thus rather "squishy". Most Yanks would interpret that as a week from tomorrow. I think. I would, anyway.

Cyberherbalist
If it's Tuesday it's pretty clearly not tomorrow. The problem is if it's Thursday. It is 6 or 13 days in the future???
Loren Pechtel
+1  A: 

According to this website it is ambiguous:

If I tell you that the company picnic is next Saturday it would be wise to ask whether I mean this coming Saturday or the Saturday after that. People differ in how they use “next” in this sort of context, and there’s no standard pattern; so it’s worth making an extra effort to be clear.

In the UK the distinction is made clear by saying “Saturday next” or “Saturday week.”

Common Errors in English

Cadoo
+1  A: 

I'm reminded of a bit from Sports Night:
Dan: Today is Thursday.
Natalie: Yes.
Dan: Today is next Thursday.
Natalie: It's this Thursday. This is next Thursday.

Anyways, I've always taken Next to mean the following occurrence of said day. While This can refer to the a day in the past as long as it isn't closer to next week.

On a Sunday:
This Wednesday: is the upcoming Wednesday
Next Wednesday: is the upcoming Wednesday

Same week: But on Wednesday
This Wednesday: is today
Next Wednesday: is the Wednesday of next week

Same week: But on Friday
This Wednesday: was 2 days ago
Next Wednesday: is the Wednesday of next week

Same week: But on Saturday
This Wednesday: is the Wednesday of next week (the days in the past is a bit arbitrary, but I usually do 2-3)
Next Wednesday: is the Wednesday of next week

MisterHux
A: 

Since there are many ways of interpreting this, I would suggest you define the words the way you want and create a chart to show what would be meant by them (trust me the words alone will be misintepreted) and then have your project manager or client or whoever is responsible to requirements definition sign off that they agree with your definitions. Make sure to get an actual signature on paper that you can pull out later when the same person whines, that it didn't calculate the way they expected. In fact get as many signatures as you can to ensure everyone who could possibly be inthe loop has seen abd agreed to your definitions.

HLGEM
if only I could cover my a** that well... but as it happens, I'm the guy writing the spec and can get away with (read shoot my foot with) just about anything.
BCS
+1  A: 

Without proper context or a predefined syntax it is impossible to infer the true meanings of "this" and "next". In English when these terms are used without context it is not uncommon for clarification to be sought or for misunderstandings to occur.

Consider the following:

  • We relaxed this weekend.
  • We're going on vacation this weekend.
  • This Wednesday is my birthday but next Wednesday is Fred's birthday.
  • This Wednesday was Fred's birthday but last Wednesday was my birthday.

It is not uncommon for this and next to be qualified in some way (e.g. "this coming Friday", "this past Friday", etc).

CptSkippy
I might have to add coming/past to the parser....
BCS
+2  A: 

Using Perl's Date::Manip, it is clear this is ambiguous ;-)

#!/usr/bin/perl

use strict;
use warnings;

use Date::Manip;

my @dates = (
    'today',
    'Tuesday',
    'this Tuesday',
    'next Tuesday',
    'previous Tuesday',
    'Friday',
    'this Friday',
    'first Tuesday of August 2009',
    'first Monday of 1900',
);

print for map {
    my $date = UnixDate($_, "%A, %B %d, %Y");
    sprintf( "%-30s : %-30s\n", $_, $date || 'stumped' );
} @dates;

Output:

C:\Temp> d
today                          : Wednesday, August 12, 2009
Tuesday                        : Tuesday, August 11, 2009
this Tuesday                   : stumped
next Tuesday                   : Tuesday, August 18, 2009
previous Tuesday               : Tuesday, August 11, 2009
Friday                         : Friday, August 14, 2009
this Friday                    : stumped
first Tuesday of August 2009   : Tuesday, August 04, 2009
first Monday of 1900           : Monday, January 01, 1900
Sinan Ünür
nice punt
BCS

related questions