#3890: mutt_mktime is ambiguous near DST change
---------------------+----------------------
Reporter: vinc17 | Owner: mutt-dev
Type: defect | Status: new
Priority: major | Milestone:
Component: mutt | Version: 1.7.1
Resolution: | Keywords:
---------------------+----------------------
Comment (by vinc17):
Concerning the implementation, the GNU C library (glibc) provides a
{{{timegm}}} function, but obviously, it is not portable. The advice from
the glibc manual is:
*Portability note:* 'mktime' is essentially universally available.
'timegm' is rather rare. For the most portable conversion from a
UTC broken-down time to a simple time, set the 'TZ' environment
variable to UTC, call 'mktime', then set 'TZ' back.
Note: This is not thread-safe, but I don't think this would matter for
Mutt.
The caller must make sure that the {{{tm_isdst}}} is properly set (this is
needed anyway).
--
Ticket URL: <https://dev.mutt.org/trac/ticket/3890#comment:1>
Mutt <http://www.mutt.org/>
The Mutt mail user agent