mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
lib_strftime: Also fix %l to avoid printing 0:xx AM/PM
This commit is contained in:
committed by
Xiang Xiao
parent
95f131c3c2
commit
9b8eedd218
@@ -305,7 +305,8 @@ size_t strftime(FAR char *s, size_t max, FAR const char *format,
|
|||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
{
|
{
|
||||||
len = snprintf(dest, chleft, "%2d", tm->tm_hour % 12);
|
len = snprintf(dest, chleft, "%2d", (tm->tm_hour % 12) != 0 ?
|
||||||
|
(tm->tm_hour % 12) : 12);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user