mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +08:00
strftime: Add support for the %R specifier
This commit is contained in:
committed by
Xiang Xiao
parent
b5052a8475
commit
097faac22f
@@ -368,6 +368,15 @@ size_t strftime(FAR char *s, size_t max, FAR const char *format,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* %R: Shortcut for %H:%M. */
|
||||||
|
|
||||||
|
case 'R':
|
||||||
|
{
|
||||||
|
len = snprintf(dest, chleft, "%02d:%02d",
|
||||||
|
tm->tm_hour, tm->tm_min);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
/* %s: The number of seconds since the Epoch, that is,
|
/* %s: The number of seconds since the Epoch, that is,
|
||||||
* since 1970-01-01 00:00:00 UTC.
|
* since 1970-01-01 00:00:00 UTC.
|
||||||
* Hmmm... mktime argume is not 'const'.
|
* Hmmm... mktime argume is not 'const'.
|
||||||
|
|||||||
Reference in New Issue
Block a user