[datetime] Stability of ptime string representation
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: 2011-07-28T10:59:30.532000 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? Thanks, Rush
participants (1)
-
Rush Manbert