Boost logo

Boost Users :

From: Scott (cheesy4poofs_at_[hidden])
Date: 2006-04-24 17:00:49


I've spent a couple hours looking over the docs for the date-time library
but still haven't been able to figure out how to do what I need to do. I'm
hoping someone on this list can shed some light on how to solve my problems.

I'm creating a logging system for our software and each log is timestamped.
I want to store in a file the boost::posix_time::ptime of each log. I
realize ptime supports boost::serialization, but we had to pull the
boost::serialization code from our server because of really strange errors
(DLL exceptions, DLLs getting unloaded while serializing, etc).

What's the best way to serialize/deserialize a ptime? The file is in a
binary format, so the most compact format is preferred.

I'm storing the ptime for each log in UTC, however I would like to convert
it to local time when the log is displayed. I saw all kinds of conversions
to local time, but all of them had the time zone hard coded. Is there a
simple way to just convert UTC to the time zone of the computer?

Thanks for any and all help,
Scott


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