diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2002-06-22 00:04:40 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2002-06-22 00:04:40 +0400 |
commit | 01f5155e982550e68f0941ff2f8d1fd9b8eb1017 (patch) | |
tree | 4decc7fabe1c98637d087b5c41133895a8e6be0a /newlib/libc/time | |
parent | 930bc96b4a9825e8b7c9d602dae0a0d79bde4ae9 (diff) |
* libc/time/strftime.c (strftime): Add %e format specifier.
Diffstat (limited to 'newlib/libc/time')
-rw-r--r-- | newlib/libc/time/strftime.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/newlib/libc/time/strftime.c b/newlib/libc/time/strftime.c index 57fe74eae..9c115b62d 100644 --- a/newlib/libc/time/strftime.c +++ b/newlib/libc/time/strftime.c @@ -64,6 +64,9 @@ A string representing the complete date and time, in the form o %d The day of the month, formatted with two digits. +o %e +The day of the month, formatted with leading space if single digit. + o %H The hour (on a 24-hour clock), formatted with two digits. @@ -257,6 +260,16 @@ _DEFUN (strftime, (s, maxsize, format, tim_p), else return 0; break; + case 'e': + if (count < maxsize - 2) + { + sprintf (&s[count], "%2d", + tim_p->tm_mday); + count += 2; + } + else + return 0; + break; case 'H': if (count < maxsize - 2) { |