[#BloombergLP-bdlt-IntervalConversionUtil-convertToDatetimeInterval]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::xref:BloombergLP/bdlt/IntervalConversionUtil.adoc[IntervalConversionUtil]::convertToDatetimeInterval
:relfileprefix: ../../../
:mrdocs:

Return the (approximate) value of `interval` as a `bdlt&colon;&colon;DatetimeInterval`&period;

== Synopsis

Declared in `&lt;bdlt&lowbar;intervalconversionutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdlt/DatetimeInterval.adoc[DatetimeInterval]
convertToDatetimeInterval(xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] const& interval);
----

== Description

Return as a `bdlt&colon;&colon;DatetimeInterval` the (approximate) value of the specified `interval` truncated toward zero, to microsecond resolution&period; The behavior is undefined unless the value of `interval`, expressed with nanosecond precision, is within the range of time intervals supported by a `DatetimeInterval` &hyphen;&hyphen; i&period;e&period;, `DT&lowbar;MIN &ast; 10&circ;6 &lt;&equals; TI&lowbar;NSECS &lt;&equals; DT&lowbar;MAX &ast; 10&circ;6`, where `TI&lowbar;NSECS` is the total number of nanoseconds in `interval`, `DT&lowbar;MIN` is the lowest (negative) value expressible by `DatetimeInterval`, and `DT&lowbar;MAX` is the highest (positive) value expressible by `DatetimeInterval`&period; Note that, while `bsls&colon;&colon;TimeInterval` has nanosecond resolution, `bdlt&colon;&colon;DatetimeInterval` has only microsecond resolution&period;

== Return Value

`interval` as a `bdlt&colon;&colon;DatetimeInterval`, truncated toward zero to microsecond resolution

== Parameters

[cols="1,4"]
|===
| Name| Description
| *interval*
| time interval to convert
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
