BloombergLP::bdlt::EpochUtil::convertToTimeT

convertToTimeT overloads

Synopses

Declared in <bdlt_epochutil.h>

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.

static
std::time_t
convertToTimeT(Datetime const& datetime);
» more...

Load into the specified result the relative time computed as the difference between the specified absolute datetime and the epoch. Return 0 on success, and a non-zero value (with no effect on result) if datetime - epoch() < DatetimeInterval() or datetime cannot be represented in the destination format on all supported platforms (i.e., the computed *result is not representable as a 32-bit int). Note that datetime is assumed to use Coordinated Universal Time (UTC) as a reference.

static
int
convertToTimeT(
    std::time_t* result,
    Datetime const& datetime);
» more...