Skip to content

Commit d0dba7f

Browse files
Ahmed Shehab (Si-Vision)keith-packard
authored andcommitted
locale/time: Fix for strftime() function with '%X' format
According to ISO/IEC 9899:1999 7.23.3.5 The strftime function '%X is replaced by the locale's appropriate time representation' (not date representation like %x) It also states in the same section 7.23.3.5 part 7: 'In the "C" locale %X is equivalent to %T' Signed-off-by: Ahmed Shehab <[email protected]>
1 parent be1b69f commit d0dba7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

newlib/libc/locale/locale_private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ extern const wchar_t *const __wtime_am_pm[2];
238238
#define TIME_AM_PM __time_am_pm
239239
#define TIME_C_FMT "%a %b %e %H:%M:%S %Y"
240240
#define TIME_X_FMT "%m/%d/%y"
241-
#define TIME_UX_FMT "%M/%D/%Y"
241+
#define TIME_UX_FMT "%H:%M:%S"
242242
#define TIME_AMPM_FMT "%I:%M:%S %p"
243243

244244
#define WTIME_ERA L""
@@ -257,7 +257,7 @@ extern const wchar_t *const __wtime_am_pm[2];
257257
#define WTIME_AM_PM __wtime_am_pm
258258
#define WTIME_C_FMT L"%a %b %e %H:%M:%S %Y"
259259
#define WTIME_X_FMT L"%m/%d/%y"
260-
#define WTIME_UX_FMT L"%M/%D/%Y"
260+
#define WTIME_UX_FMT L"%H:%M:%S"
261261
#define WTIME_AMPM_FMT L"%I:%M:%S %p"
262262

263263
static inline bool

0 commit comments

Comments
 (0)