[pkg-boost-devel] Bug#469771: date_time::date_formatting.hpp: incorrectly formats year using global locale

Jean Pierre LeJacq jplejacq at quoininc.com
Fri Mar 7 00:21:41 UTC 2008

Package: libboost-date-time-dev
Version: 1.34.1-7
Severity: important

The function boost::date_time::ymd_formatter::ymd_to_string() uses the
ostream<<() function to write the date. This later function will use the
current global locale to format each of the elements of the date. In
particular, when the global locale is set to en_US, the year will be
formatted to be 2,008 which is incorrect.

The proposed solution is to temporarily imbue the ostream with the
classic locale to disable formatting. The attached patch only applies
this to the year but it would be more robust to apply to the day and
month components as well. 

This type of error probably exists in other functions.

This error was reported upstream as ticket #1674.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-qi.pe1650 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libboost-date-time-dev depends on:
ii  libboost-date-time1.34.1      1.34.1-7   set of date-time libraries based o
ii  libboost-dev                  1.34.1-7   Boost C++ Libraries development fi

libboost-date-time-dev recommends no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: boost_date_time_date_formatting_hpp.patch
Type: text/x-c++
Size: 595 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-boost-devel/attachments/20080306/067a3aa4/attachment.bin 

More information about the pkg-boost-devel mailing list