https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71556

            Bug ID: 71556
           Summary: set::get_time() requires leading 0s for %H and friends
           Product: gcc
           Version: 6.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: j...@jak-linux.org
  Target Milestone: ---

Created attachment 38713
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38713&action=edit
C++ reproducer

In contrast to strptime(), std::get_time() requires leading zeroes for %H and
friends, so times with " 9" (%k formatting) instead of "09" cannot be parsed.
The C++ standard requires get_time() to work like strptime(), as far as I can
tell, and cppreference tells us that leading 0s are permitted, but optional.

This means we cannot parse a date like: "Thu, 16 Jun 2016  9:35:47 UTC" which
in turn breaks date parsing for recent APT versions when we switched from
strptime to std::get_time().

Reply via email to