[#BloombergLP-bslmt-ChronoUtil-durationToTimeInterval]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/ChronoUtil.adoc[ChronoUtil]::durationToTimeInterval
:relfileprefix: ../../../
:mrdocs:

Convert a chrono duration to a `bsls&colon;&colon;TimeInterval`&period;

== Synopsis

Declared in `&lt;bslmt&lowbar;chronoutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class REP&lowbar;TYPE,
    class PERIOD&lowbar;TYPE&gt;
static
xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval]
durationToTimeInterval(bsl::chrono::duration&lt;REP&lowbar;TYPE, PERIOD&lowbar;TYPE&gt; const& duration);
----

== Description

Return a `bsls&colon;&colon;TimeInterval` having the value represented by the specified `duration`&period; Unlike the implicit conversion defined from duration defined in `bsls&colon;&colon;TimeInterval`, this conversion handles floating&hyphen;point&hyphen;based durations as well as integral ones&period;

== Return Value

a `bsls&colon;&colon;TimeInterval` having the value of `duration`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *duration*
| chrono duration to convert
|===


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