Boost logo

Boost :

From: Norian N (noriann_at_[hidden])
Date: 2005-12-06 12:14:22


  I'm trying to use Boost 1.33 libs on x64 Windows platform. Have assert
break when try to use date below year 1900.
  Is it known issue?

To reproduce:

#include "stdafx.h"
#include <iostream>
#include <boost/date_time/local_time/local_time.hpp>

int _tmain(int argc, _TCHAR* argv[])
{
  using namespace boost::gregorian;
  using namespace std;

  date d(1899, Jan, 1);
  stringstream ss;
  ss << d;
  cout << ss << endl;
  return 0;
}

The cause located in conversion.hpp module and strftime() assert :

    boost::gregorian::date::ymd_type ymd = d.year_month_day();
    datetm.tm_year = ymd.year-1900;

_VALIDATE_RETURN( ( timeptr->tm_year >=0 ), EINVAL, FALSE)

Thanks,

  Dmitry Solodkiy, SW engineer


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk