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

approxidate parsing for bad time units

From
JMJeffrey Middleton <jefromi@gmail.com>
Date
Sep 6, 2012, 16:24 UTC
Message-ID
<CAFE6XRFgQa10vTWXfxRG53W6K4U=VGqpK5sQwH7xp9GfKd=2Uw@mail.gmail.com>

In telling someone what date formats git accepts, and how to verify it understands, I noticed this weirdness:

$ export TEST_DATE_NOW=`date -u +%s --date='September 10'`; ./test-date approxidate now; for i in `seq 1 10`; do ./test-date approxidate "$i frobbles ago"; done now -> 2012-09-10 00:00:00 +0000 1 frobbles ago -> 2012-09-02 00:00:00 +0000 2 frobbles ago -> 2012-09-03 00:00:00 +0000 3 frobbles ago -> 2012-09-04 00:00:00 +0000 4 frobbles ago -> 2012-09-05 00:00:00 +0000 5 frobbles ago -> 2012-09-06 00:00:00 +0000 6 frobbles ago -> 2012-09-07 00:00:00 +0000 7 frobbles ago -> 2012-09-08 00:00:00 +0000 8 frobbles ago -> 2012-09-09 00:00:00 +0000 9 frobbles ago -> 2012-09-10 00:00:00 +0000 10 frobbles ago -> 2012-09-11 00:00:00 +0000

Which gets more concerning once you realize the same thing happens no matter what fake unit of time you use... including things like "yaers" and "moths". Perhaps approxidate could be a little stricter?

Thanks, Jeffrey

Next: Junio C Hamano
Message 1 of 6 in “approxidate parsing for bad time units”
  1. Jeffrey MiddletonSep 6, 2012
  2. Junio C HamanoSep 6, 2012
  3. Jeffrey MiddletonSep 6, 2012
  4. Jeff KingSep 7, 2012
  5. Jeffrey MiddletonSep 10, 2012
  6. Jeff KingSep 10, 2012

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.