Boost logo

Boost Users :

Subject: [Boost-users] [datetime] Stability of ptime string representation
From: Rush Manbert (rush_at_[hidden])
Date: 2010-07-28 14:11:46

I have an application that uses the string representation of a ptime object in a way that requires that representation to be stable across many years and across multiple releases of the DateTime library.

We started out using the to_iso_extended_string() method to generate the string representation. I am worried that the periodic addition of leap seconds could mess me up. The scenario is rather complicated:

Let's say that I go into production tomorrow using Boost 1.42. All is well. The Powers That Be decide that there will be a leap second added at the end of 2010. We keep using 1.42.

A year from now I record a time value. If I did it exactly one year from when I'm writing this, the to_iso_extended_string() representation would be:

In 2012, we change out our Boost libraries for version 1.50, which contains a new version of the DateTime library which I assume knows about the leap second that was added at the end of 2010.

Here's what I'm worrying about: If, sometime in 2012 after we switch libraries, I retrieve the ptime value that I recorded in 2011 by calling to_iso_extended_string(), will I get the same string that I was getting in 2011 when I was running on a pre-leap-second-addition version of DateTime, or will it be different by a second?


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at