Return seconds from the epoch to the specified datetime.
Synopsis
Declared in <bdlt_epochutil.h>
static
std::time_t
convertToTimeT(Datetime const& datetime);
Description
Return the relative time computed as the difference between the specified absolute datetime and the epoch. The behavior is undefined unless datetime ‐ epoch() >= DatetimeInterval() and the converted datetime can be represented in the destination format on all supported platforms (i.e., the resultant value is representable as a 32‐bit int). Note that datetime is assumed to use Coordinated Universal Time (UTC) as a reference. Also note that if error detection is desired, the overloaded version that loads the converted datetime into a supplied destination object should be used.
Return Value
seconds from the epoch to datetime
Parameters
Name |
Description |
datetime |
absolute datetime in UTC |
Created with MrDocs