Project

General

Profile

Actions

Bug #4478

closed

time::fromIsoString doesn't decode large dates

Added by Alex Afanasyev about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Utils
Target version:
Start date:
01/25/2018
Due date:
% Done:

100%

Estimated time:

Description

BOOST_AUTO_TEST_CASE(LargeDates)
{
  auto value = fromUnixTimestamp(milliseconds(1390966967032LL));
  BOOST_CHECK_EQUAL(toIsoString(value), "20140129T034247.032000");
  BOOST_CHECK_EQUAL(fromIsoString("20140129T034247.032000"), value);

  value += days(365 * 100 + 25 - 1); // 36524 days
  BOOST_CHECK_EQUAL(toIsoString(value), "21140129T034247.032000");
  BOOST_CHECK_EQUAL(fromIsoString("21140129T034247.032000"), value);
}

Expected: all tests passed

Actual:

../tests/unit-tests/util/time.t.cpp(89): error in "LargeDates": check fromIsoString("21140129T034247.032000") == value failed [251673271032000000 nanoseconds since Jan 1, 1970 != 4546640567032000000 nanoseconds since Jan 1, 1970]

Note. The issue seem to have been fixed in Boost 1.66 and later, however all Linux distributions have older versions of Boost that have the issue.


Related issues 2 (0 open2 closed)

Related to ndn-cxx - Bug #3915: time::toIsoString and time::toString overflow with large datesClosedJunxiao Shi01/11/2017

Actions
Related to ndn-cxx - Bug #4476: Wrong ValidityPeriod.NotAfter in certificate expiring after year 2038ClosedAlex Afanasyev01/25/2018

Actions
Actions

Also available in: Atom PDF