Index: src/number-match.c
===================================================================
--- src/number-match.c	(revision 16813)
+++ src/number-match.c	(working copy)
@@ -254,7 +254,7 @@ datetime_locale_setup (char const *lc_time)
 	 * "31/1/2001"     [Jan 31] if !month_before_day
 	 */
 	datetime_locale_setup1 (&datetime_locale.re_mmddyyyy,
-				"^(\\d+)[-/.](\\d+)[-/.](\\d+)\\b");
+				"^(\\d+)([-/.])(\\d+)[-/.](\\d+)\\b");
 
 	/*
 	 * "2005/2"   [Feb 1]
@@ -592,9 +592,10 @@ format_match_datetime (char const *text,
 	GORegmatch match[31];
 	gunichar uc;
 	int dig1;
-	char const *date_format = NULL;
+	char *date_format = NULL;
 	GnmValue *v = NULL;
 	const char *time_format = NULL;
+	char sep;
 
 	if (lc_time != datetime_locale.lc_time &&
 	    (lc_time == NULL ||
@@ -670,22 +671,26 @@ format_match_datetime (char const *text,
 		}
 	}
 
-	/* ^(\d+)[-/.](\d+)[-/.](\d+)\b */
-	/*  1         2         3       */
+	/* ^(\d+)([-/.])(\d+)[-/.](\d+)\b */
+	/*  1    2      3         4       */
 	if (dig1 >= 0 &&
 	    go_regexec (&datetime_locale.re_mmddyyyy, text, G_N_ELEMENTS (match), match, 0) == 0) {
 		if (month_before_day) {
 			month = handle_month (text, match + 1);
-			day = handle_day (text, match + 2);
+			day = handle_day (text, match + 3);
 		} else {
-			month = handle_month (text, match + 2);
+			month = handle_month (text, match + 3);
 			day = handle_day (text, match + 1);
 		}
-		year = handle_year (text, match + 3);
+		year = handle_year (text, match + 4);
 		if (g_date_valid_dmy (day, month, year)) {
-			date_format = month_before_day
-				? "m/d/yyyy"
-				: "d/m/yyyy";
+			sep = text[match[2].rm_so];
+			date_format = g_malloc(strlen("m*d*yyyy")+1);
+			if (month_before_day) {
+				sprintf(date_format, "m%cd%cyyyy", sep, sep);
+			} else {
+				sprintf(date_format, "d%cm%cyyyy", sep, sep);
+			}
 			text += match[0].rm_eo;
 			goto got_date;
 		}
@@ -730,6 +735,7 @@ format_match_datetime (char const *text,
 		}
 	}
 
+	g_free(date_format);
 	return NULL;
 
  got_date:
@@ -770,6 +776,7 @@ format_match_datetime (char const *text,
 		value_set_fmt (v, fmt);
 		go_format_unref (fmt);
 	}
+	g_free(date_format);
 
 	return v;
 }
Index: src/gnm-format.c
===================================================================
--- src/gnm-format.c	(revision 16813)
+++ src/gnm-format.c	(working copy)
@@ -274,7 +274,14 @@ gnm_format_for_date_editing (GnmCell const *cell)
 		? gnm_format_month_before_day (gnm_cell_get_format (cell),
 					       cell->value)
 		: go_locale_month_before_day ();
+	GString *s;
 
+	s = go_locale_get_date_format();
+
+	if (s && s->str) {
+		return go_format_new_from_XL (s->str);
+	}
+
 	switch (mbd) {
 	case 0: return go_format_new_from_XL ("d/m/yyyy");
 	default:
