This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/26701] New: std::time_get parses only 2 digits of year, in en_GB locale.
- From: "murrayc at murrayc dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Mar 2006 17:43:58 -0000
- Subject: [Bug libstdc++/26701] New: std::time_get parses only 2 digits of year, in en_GB locale.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The attached test case shows that std::time_get<> parses only the first 2
digits of years, and assumes that those are years in the 1900s. This is a loss
of data.
It gives this output, in an en_GB locale:
murrayc@ubuntumurrayc:~$ ./a.out
The date as text: 01/02/2003
std::time_get result: day=1, month=2, year=1920
Maybe time_get tries to use the strftime date format only, which uses 2 digits
only for display in en_GB.
murrayc@ubuntumurrayc:~$ g++ --version
g++ (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu1)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--
Summary: std::time_get parses only 2 digits of year, in en_GB
locale.
Product: gcc
Version: 4.0.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: murrayc at murrayc dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26701