You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/10/25 07:07:40 UTC

[GitHub] [incubator-nuttx] midokura-xavi92 opened a new pull request, #7424: Strftime new specifiers

midokura-xavi92 opened a new pull request, #7424:
URL: https://github.com/apache/incubator-nuttx/pull/7424

   ## Summary
   This PR adds two missing conversion specifiers supplied by [`strftime(3)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html) that are defined by POSIX.1-2017, namely `%R` and `%T`.
   
   ## Impact
   
   ## Testing
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] midokura-xavi92 commented on a diff in pull request #7424: Add %T and %R conversion specifiers to strftime(3)

Posted by GitBox <gi...@apache.org>.
midokura-xavi92 commented on code in PR #7424:
URL: https://github.com/apache/incubator-nuttx/pull/7424#discussion_r1004455480


##########
libs/libc/time/lib_strftime.c:
##########
@@ -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);

Review Comment:
   Thanks, I have just rebased the branch according to your suggestions.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #7424: Add %T and %R conversion specifiers to strftime(3)

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #7424:
URL: https://github.com/apache/incubator-nuttx/pull/7424


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7424: Add %T and %R conversion specifiers to strftime(3)

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7424:
URL: https://github.com/apache/incubator-nuttx/pull/7424#discussion_r1004269568


##########
libs/libc/time/lib_strftime.c:
##########
@@ -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);

Review Comment:
   ```suggestion
                  len = snprintf(dest, chleft, "%02d:%02d",
                                 tm->tm_hour, tm->tm_min);
   ```



##########
libs/libc/time/lib_strftime.c:
##########
@@ -399,6 +408,15 @@ size_t strftime(FAR char *s, size_t max, FAR const char *format,
              }
              break;
 
+           /* %T: Shortcut for %H:%M:%S. */
+
+           case 'T':
+             {
+               len = snprintf(dest, chleft, "%02d:%02d:%02d",
+                tm->tm_hour, tm->tm_min, tm->tm_sec);

Review Comment:
   ```suggestion
                  len = snprintf(dest, chleft, "%02d:%02d:%02d",
                                 tm->tm_hour, tm->tm_min, tm->tm_sec);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org