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

[PATCH] parse_date(): fix parsing 03/10/2006

From
Junio C Hamano <junkio@cox.net>
Date
Apr 5, 2006, 06:00 UTC
Message-ID
<7vodzg4l5n.fsf@assigned-by-dhcp.cox.net>

The comment associated with the date parsing code for three numbers separated with slashes or dashes implied we wanted to interpret using this order:

	yyyy-mm-dd
	yyyy-dd-mm
	mm-dd-yy
	dd-mm-yy

However, the actual code had the last two wrong, and making it prefer dd-mm-yy format over mm-dd-yy.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 * Spotted, thanks to Len Brown and Andrew Morton.
 date.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
f5cd7df6e8322a0b783668b31881ab95a5ce33bd
diff --git a/date.c b/date.c
index 416ea57..18a0710 100644
--- a/date.c
+++ b/date.c
@@ -257,10 +257,10 @@ static int match_multi_number(unsigned l
 				break;
 		}
 		/* mm/dd/yy ? */
-		if (is_date(num3, num2, num, tm))
+		if (is_date(num3, num, num2, tm))
 			break;
 		/* dd/mm/yy ? */
-		if (is_date(num3, num, num2, tm))
+		if (is_date(num3, num2, num, tm))
 			break;
 		return 0;
 	}
-- 
1.3.0.rc2.g110c
Next: Andrew Morton
Message 1 of 8 in “parse_date(): fix parsing 03/10/2006”
  1. parse_date(): fix parsing 03/10/2006Junio C Hamano, Apr 5, 2006
  2. Andrew MortonApr 5, 2006
  3. Junio C HamanoApr 5, 2006
  4. Andrew MortonApr 5, 2006
  5. date parsing: be friendlier to our European friends.Junio C Hamano, Apr 5, 2006
  6. Sam RavnborgApr 5, 2006
  7. Junio C HamanoApr 5, 2006
  8. David WoodhouseJul 14, 2006

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.