{
struct tm tm;
const char *loc;
- p_clear(&tm, 1);
loc = setlocale(LC_TIME, "C");
- s = strptime(s, "%a, %d %b %Y %T %z", &tm);
+
+ p_clear(&tm, 1);
+ if (strptime(s, "%a, %d %b %Y %H:%M:%S %z", &tm))
+ goto ok;
+ p_clear(&tm, 1);
+ if (strptime(s, "%a, %d %b %Y %H:%M %z", &tm))
+ goto ok;
+ setlocale(LC_TIME, loc);
+ return 0;
+
+ ok:
setlocale(LC_TIME, loc);
return mutt_mktime(&tm, 1);
}