From 01f5155e982550e68f0941ff2f8d1fd9b8eb1017 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 21 Jun 2002 20:04:40 +0000 Subject: * libc/time/strftime.c (strftime): Add %e format specifier. --- newlib/libc/time/strftime.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'newlib/libc/time/strftime.c') 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) { -- cgit v1.2.3