Chapter 12. Serializing date/time data

Objects of type std::tm are supported by the library and are mapped to the SQL DATETIME type. Values that are passed to the library for saving must be Greenwich Mean Time (GMT) values, a.k.a. Universal Coordinated Time (UTC) values. Doing so removes time-zone conversion errors as a source of problems. Upon loading, the library will return values in GMT/UTC format, and clients can then transform the value to local timezone date/time, if required. Note that Windows has limited time-zone conversion support, so the library requires UTC values on that platform.

If other date/time formats need to be serialized, you will need to convert to/from std::tm or write your own date/time serializers. Again, make sure the value you pass is a UTC/GMT value, not a local timezone date/time.