summaryrefslogtreecommitdiff
path: root/lib/strptime.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/strptime.c')
-rw-r--r--lib/strptime.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/strptime.c b/lib/strptime.c
index a6a306c..c8e436e 100644
--- a/lib/strptime.c
+++ b/lib/strptime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2004-2005, 2007, 2009-2016 Free Software Foundation,
+/* Copyright (C) 2002, 2004-2005, 2007, 2009-2017 Free Software Foundation,
Inc.
This file is part of the GNU C Library.
@@ -525,6 +525,15 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
return NULL;
}
break;
+ case 'q':
+ /* Match quarter of year. GNU extension. */
+ get_number (1, 4, 1);
+ tm->tm_mon = (val - 1) * 3;
+ tm->tm_mday = 1;
+ have_mon = 1;
+ have_mday = 1;
+ want_xday = 1;
+ break;
case 'r':
#ifdef _NL_CURRENT
if (*decided != raw)
@@ -982,6 +991,15 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
get_alt_number (0, 59, 2);
tm->tm_min = val;
break;
+ case 'q':
+ /* Match quarter using alternate numeric symbols. */
+ get_alt_number (1, 4, 1);
+ tm->tm_mon = (val - 1) * 3;
+ tm->tm_mday = 1;
+ have_mon = 1;
+ have_mday = 1;
+ want_xday = 1;
+ break;
case 'S':
/* Match seconds using alternate numeric symbols. */
get_alt_number (0, 61, 2);