This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 2ac3e3c  libs/libc/time: update description of strftime
2ac3e3c is described below

commit 2ac3e3c7930eadbdb4a6a4ec94f9379fe1a41370
Author: Petro Karashchenko <petro.karashche...@gmail.com>
AuthorDate: Sun Mar 27 15:20:00 2022 +0200

    libs/libc/time: update description of strftime
    
    Signed-off-by: Petro Karashchenko <petro.karashche...@gmail.com>
---
 libs/libc/time/lib_strftime.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/libs/libc/time/lib_strftime.c b/libs/libc/time/lib_strftime.c
index d30d380..352b970 100644
--- a/libs/libc/time/lib_strftime.c
+++ b/libs/libc/time/lib_strftime.c
@@ -99,6 +99,8 @@ static const char * const g_monthname[12] =
  *   ter,  and  terminated  by  a  conversion  specifier  character, and are
  *   replaced in s as follows:
  *
+ *   %a     The abbreviated weekday name according to the current locale.
+ *   %A     The full weekday name according to the current locale.
  *   %b     The abbreviated month name according to the current locale.
  *   %B     The full month name according to the current locale.
  *   %C     The century number (year/100) as a 2-digit integer. (SU)
@@ -221,16 +223,6 @@ size_t strftime(FAR char *s, size_t max, FAR const char 
*format,
              }
              break;
 
-           /* %y: The year as a decimal number without a century
-            * (range 00 to 99).
-            */
-
-           case 'y':
-             {
-               len = snprintf(dest, chleft, "%02d", tm->tm_year % 100);
-             }
-             break;
-
            /* %C: The century number (year/100) as a 2-digit integer. */
 
            case 'C':
@@ -406,6 +398,16 @@ size_t strftime(FAR char *s, size_t max, FAR const char 
*format,
              }
              break;
 
+           /* %y: The year as a decimal number without a century
+            * (range 00 to 99).
+            */
+
+           case 'y':
+             {
+               len = snprintf(dest, chleft, "%02d", tm->tm_year % 100);
+             }
+             break;
+
            /* %Y: The year as a decimal number including the century. */
 
            case 'Y':

Reply via email to