Opened 6 years ago

Closed 5 years ago

#12609 closed Bugs (fixed)

time_duration::total_seconds doesn't return long for LP64 model

Reported by: anonymous Owned by: James E. King, III
Milestone: Boost 1.67.0 Component: date_time
Version: Boost 1.62.0 Severity: Problem
Keywords: Cc:

Description

The documentation says that time_duration::total_seconds() returns long (http://www.boost.org/doc/libs/1_62_0/doc/html/date_time/posix_time.html).

But for LP64 models (e.g. Linux, 64bit) it returns signed 32bit integer, not long (signed 64bit integer).

It looks like time_resolution_traits::v_type (boost/date_time/time_resolution_traits.hpp) should be changed. At the moment it uses int32_t which is not correct for LP64 model because the documentation says it must be long.

Change History (5)

comment:1 by James E. King, III, 5 years ago

Owner: changed from az_sw_dude to James E. King, III
Status: newassigned

This was resolved in 1.66.0 by https://github.com/boostorg/date_time/pull/35 thus changing the value to std::time_t, therefore all of those methods will return std::time_t. The documentation was not updated, however, so I will levae this open for that purpose.

comment:2 by James E. King, III, 5 years ago

The documentation issue is resolved with https://github.com/boostorg/date_time/pull/58

comment:3 by James E. King, III, 5 years ago

Milestone: To Be DeterminedBoost 1.66.0

comment:4 by James E. King, III, 5 years ago

Milestone: Boost 1.66.0Boost 1.67.0

Given the serialization issues in 1.66.0 due to the std::time_t fix (in 1.67.0 it was changed to uint64_t to be uniform across all environments), I'm changing the milestone to 1.67.0 here.

comment:5 by James E. King, III, 5 years ago

Resolution: fixed
Status: assignedclosed

Fix merged to master; resolved.

Note: See TracTickets for help on using tickets.