strftime: Added support for the %w format specifier.
This commit is contained in:
parent
f9fd53cda1
commit
ec93385dfa
@ -130,6 +130,7 @@ static const char * const g_monthname[12] =
|
|||||||
* %S The second as a decimal number (range 00 to 60). (The range is
|
* %S The second as a decimal number (range 00 to 60). (The range is
|
||||||
* up to 60 to allow for occasional leap seconds.)
|
* up to 60 to allow for occasional leap seconds.)
|
||||||
* %t A tab character. (SU)
|
* %t A tab character. (SU)
|
||||||
|
* %w The weekday as a decimal number (range 0 to 6).
|
||||||
* %y The year as a decimal number without a century (range 00 to 99).
|
* %y The year as a decimal number without a century (range 00 to 99).
|
||||||
* %Y The year as a decimal number including the century.
|
* %Y The year as a decimal number including the century.
|
||||||
* %% A literal '%' character.
|
* %% A literal '%' character.
|
||||||
@ -398,6 +399,14 @@ size_t strftime(FAR char *s, size_t max, FAR const char *format,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* %w: The weekday as a decimal number (range 0 to 6). */
|
||||||
|
|
||||||
|
case 'w':
|
||||||
|
{
|
||||||
|
len = snprintf(dest, chleft, "%d", tm->tm_wday);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
/* %y: The year as a decimal number without a century
|
/* %y: The year as a decimal number without a century
|
||||||
* (range 00 to 99).
|
* (range 00 to 99).
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user