git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Teach "approxidate" about weekday syntax

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 17, 2005, 21:44 UTC
Message-ID
<Pine.LNX.4.63.0511172242390.18285@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<Pine.LNX.4.64.0511171622450.14287@localhost.localdomain>
Hi,
On Thu, 17 Nov 2005, Nicolas Pitre wrote:
Show 12 quoted lines
> 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

Previous: Nicolas PitreNext: Junio C Hamano
Message 3 of 26 in “Teach "approxidate" about weekday syntax”
  1. Linus TorvaldsNov 17, 2005
  2. Nicolas PitreNov 17, 2005
  3. Johannes SchindelinNov 17, 2005
  4. Junio C HamanoNov 17, 2005
  5. Linus TorvaldsNov 17, 2005
  6. Linus TorvaldsNov 17, 2005
  7. David RoundyNov 18, 2005
  8. Johannes SchindelinNov 18, 2005
  9. Randy.DunlapNov 18, 2005
  10. Linus TorvaldsNov 18, 2005
  11. Junio C HamanoNov 19, 2005
  12. Andreas EricssonNov 19, 2005
  13. Randal L. SchwartzNov 19, 2005
  14. Linus TorvaldsNov 19, 2005
  15. Matthias UrlichsNov 18, 2005
  16. Johannes SchindelinNov 20, 2005
  17. H. Peter AnvinNov 18, 2005
  18. Linus TorvaldsNov 18, 2005
  19. Andreas EricssonNov 18, 2005
  20. Linus TorvaldsNov 18, 2005
  21. Johannes SchindelinNov 17, 2005
  22. Martin LanghoffNov 18, 2005
  23. Linus TorvaldsNov 18, 2005
  24. Johannes SchindelinNov 18, 2005
  25. H. Peter AnvinNov 17, 2005
  26. Linus TorvaldsNov 17, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.