From: Johannes Schindelin Date: Thu, 17 Nov 2005 21:44:05 GMT Subject: Re: Teach "approxidate" about weekday syntax Message-ID: In-Reply-To: Hi, On Thu, 17 Nov 2005, Nicolas Pitre wrote: > On Thu, 17 Nov 2005, Linus Torvalds wrote: > > > NOTE! The parsing is strictly sequential, so if you do > > > > "one day before last thursday" > > > > it will _not_ do what you think it does. It will take the current time, > > subtract one day, and then go back to the thursday before that. > > Maybe if you applied the different time units in decreasing size that > would do the trick? e.g. months have precedence over weeks, weeks over > weekdays, weekdays over days, etc. Or even better: make it relative until you find an absolute reference. I.e. "one day" will be 1 * 86400, and if you then parse "before", it will get negative, then "last thursday" will be the absolute reference. 'f course, "one day before last thursday in september" will be a PITA. Ciao, Dscho