Boost logo

Boost Users :

Subject: Re: [Boost-users] [date_time] binary serialization / integer representation
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2009-10-21 13:30:28


Igor R wrote:
>
> I also can't see any access to the internal value, so what you can do
> instead is to make some time_duration, and use it instead of the absolute
> ptime. Like this:
>
> pt::ptime epoch(greg::date(1970, 1, 1)); // or some other reference
> point pt::time_duration duration = t - epoch;
> boost::int64_t diff = duration.total_seconds(); // or
> total_microseconds()
> or ticks()
> Similarly, you can reconstruct the ptime later.

Thanks, it comes close to a solution, it would take some more work to
represent special values. It is kind of reimplementing the counted time
system stuff :-/ Perhaps a memcpy() of a ptime will do the trick, too.

Cheers,

Rutger


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net