Opened 6 years ago

#12699 new Feature Requests

posix_time\time_formatters removes trailing 0 fractional seconds

Reported by: Jonathan Zuber <jonathan.zuber@…> Owned by: az_sw_dude
Milestone: To Be Determined Component: date_time
Version: Boost 1.63.0 Severity: Cosmetic
Keywords: Time, Fractional Seconds, Cc:

Description

When calling boost::posix_time::to_iso_extended_string(), the returned format will differ depending on the value of the fractional seconds. This cannot be configured. In time_formatters.hpp, function 'to_simple_string_type' checks if the value of the fractional seconds is 0 (zero). If it is, it will not print the corresponding fractional seconds digits.

I consider this a bug because if one is to display multiple ptimes in this format they could have differing widths which would not be visually appealing.

I propose that this is changed to be either:

1) User controlled. The user can set whether or not to print the characters.

OR

2) It should always print the fractional seconds digits.

I believe that option 1) is the correct solution, though at the very least I believe option 2) to be more correct than the current implementation.

Change History (0)

Note: See TracTickets for help on using tickets.