Quick Links:

bal | bbl | bdl | bsl

Namespaces

Component bdlt_datetimeimputil
[Package bdlt]

Provide constants useful for encoding datetimes. More...

Namespaces

namespace  bdlt

Detailed Description

Outline
Purpose:
Provide constants useful for encoding datetimes.
Classes:
bdlt::DatetimeImpUtil namespace for datetime encoding constants
Description:
This component implements a utility struct, bdlt::DatetimeImpUtil, that defines a namespace for obtaining constants and bdlt::Datetime * to constant values that are useful to encoding datetimes at static-initilaization time. The assumptions for this encoding are that a collection of unset values, one per day over the valid range of bdlt::Date, are encoded in the lowest values, and then microsecond resolution over the entire bdlt::Date range.
Usage:
This section illustrates intended use of this component.
Example 1: Basic Syntax:
To obtain the bdlt::Datetime internal value for 0001/01/01 at static-initialization time:
  static const bdlt::Datetime *firstDatetime =
                                   bdlt::DatetimeImpUtil::epoch_0001_01_01();

  assert(reinterpret_cast<const bdlt::Datetime *>(
               &bdlt::DatetimeImpUtil::k_0001_01_01_VALUE) == firstDatetime);