BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bdlt::IntervalConversionUtil Struct Reference

#include <bdlt_intervalconversionutil.h>

Detailed Description

This utility struct, IntervalConversionUtil, defines functions to convert between bsls::TimeInterval and bdlt::DatetimeInterval representations of time intervals.

See bdlt_intervalconversionutil

Static Public Member Functions

static DatetimeInterval convertToDatetimeInterval (const bsls::TimeInterval &interval)
 
static bsls::TimeInterval convertToTimeInterval (const DatetimeInterval &interval)
 

Member Function Documentation

◆ convertToDatetimeInterval()

DatetimeInterval bdlt::IntervalConversionUtil::convertToDatetimeInterval ( const bsls::TimeInterval interval)
inlinestatic

Return as a bdlt::DatetimeInterval the (approximate) value of the specified interval truncated toward zero, to microsecond resolution.

Precondition
The behavior is undefined unless the value of interval, expressed with nanosecond precision, is within the range of time intervals supported by a DatetimeInterval – i.e., DT_MIN * 10^6 <= TI_NSECS <= DT_MAX * 10^6, where TI_NSECS is the total number of nanoseconds in interval, DT_MIN is the lowest (negative) value expressible by DatetimeInterval, and DT_MAX is the highest (positive) value expressible by DatetimeInterval.
Note
Note that, while bsls::TimeInterval has nanosecond resolution, bdlt::DatetimeInterval has only microsecond resolution.

◆ convertToTimeInterval()

bsls::TimeInterval bdlt::IntervalConversionUtil::convertToTimeInterval ( const DatetimeInterval interval)
inlinestatic

Return as a bsls::TimeInterval the value of the specified interval.


The documentation for this struct was generated from the following file: