diff options
author | Brian Inglis <Brian.Inglis@SystematicSW.ab.ca> | 2022-10-22 08:15:18 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2022-10-24 15:07:23 +0300 |
commit | d6a26e542da06d0ded2b8eefbd019fc93fdec019 (patch) | |
tree | bea36cc34ba881ae88fd356c9b214d24a878b83f /newlib/libc | |
parent | 7589034cc3151bfac8cc3d3af5e91402a78e160b (diff) |
strptime.c(strptime_l): add %q GNU quarter
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/time/strptime.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/newlib/libc/time/strptime.c b/newlib/libc/time/strptime.c index 12b2ef469..6220ff73a 100644 --- a/newlib/libc/time/strptime.c +++ b/newlib/libc/time/strptime.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999 Kungliga Tekniska Högskolan + * Copyright (c) 1999 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -298,6 +298,14 @@ strptime_l (const char *buf, const char *format, struct tm *timeptr, } else timeptr->tm_hour += 12; break; + case 'q' : /* quarter year - GNU extension */ + ret = strtol_l (buf, &s, 10, locale); + if (s == buf) + return NULL; + timeptr->tm_mon = (ret - 1)*3; + buf = s; + ymd |= SET_MON; + break; case 'r' : /* %I:%M:%S %p */ s = strptime_l (buf, _ctloc (ampm_fmt), timeptr, locale); if (s == NULL) |