strftime: Add support for the %R specifier

This commit is contained in:
Xavier Del Campo 2022-10-25 08:54:23 +02:00 committed by Xiang Xiao
parent b5052a8475
commit 097faac22f

View File

@ -368,6 +368,15 @@ size_t strftime(FAR char *s, size_t max, FAR const char *format,
}
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,
* since 1970-01-01 00:00:00 UTC.
* Hmmm... mktime argume is not 'const'.