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/08/11 07:31:27 UTC

[GitHub] [incubator-nuttx] pkarashchenko opened a new issue, #6832: mktime() does not "normalize" struct tm argument

pkarashchenko opened a new issue, #6832:
URL: https://github.com/apache/incubator-nuttx/issues/6832

   [Linux mktime|https://linux.die.net/man/3/mktime]:
   ```
   The mktime() function modifies the fields of the tm structure as follows: tm_wday and tm_yday are set to values determined from the contents of the other fields; if structure members are outside their valid interval, they will be normalized (so that, for example, 40 October is changed into 9 November); tm_isdst is set (regardless of its initial value) to a positive value or to 0, respectively, to indicate whether DST is or is not in effect at the specified time. Calling mktime() also sets the external variable tzname with information about the current timezone.
   ```
   [FreeBSD mktime|https://www.freebsd.org/cgi/man.cgi?query=mktime]:
   ```
   The original values of the	tm_wday	and tm_yday components of the struc-
        ture are ignored, and the original	values of the other components are not
        restricted	to their normal	ranges,	and will be normalized if needed.  For
        example, October 40 is changed into November 9, a tm_hour of -1 means 1
        hour before midnight, tm_mday of 0	means the day preceding	the current
        month, and	tm_mon of -2 means 2 months before January of tm_year.	(A
        positive or zero value for	tm_isdst causes	mktime() to presume initially
        that summer time (for example, Daylight Saving Time) is or	is not in ef-
        fect for the specified time, respectively.	 A negative value for tm_isdst
        causes the	mktime() function to attempt to	divine whether summer time is
        in	effect for the specified time.	The tm_isdst and tm_gmtoff members are
        forced to zero by timegm().)
   ```
   [OpenGroup mktime|https://pubs.opengroup.org/onlinepubs/9699919799/functions/mktime.html] does not state anything about normalization.


-- 
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.apache.org

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


[GitHub] [incubator-nuttx] xiaoxiang781216 closed issue #6832: mktime() does not "normalize" struct tm argument

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 closed issue #6832: mktime() does not "normalize" struct tm argument
URL: https://github.com/apache/incubator-nuttx/issues/6832


-- 
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