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

This `struct` provides a namespace for current&hyphen;time&hyphen;retrieval procedures including a configurable global callback mechanism&period; The use of a _subset_ of these procedures is thread&hyphen;safe (see `Thread Safety`)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct CurrentTime;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlt/CurrentTime/CurrentTimeCallback-02.adoc[`CurrentTimeCallback`] 
| `CurrentTimeCallback` is a callback function pointer for a callback function that returns a `bsls&colon;&colon;TimeInterval` object&period; This function must be thread&hyphen;safe in multi&hyphen;threaded builds&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlt/CurrentTime/asDatetimeTz.adoc[`asDatetimeTz`] 
| Return the `DatetimeTz` value representing the current date&sol;time in the local time zone, and the local time zone&apos;s offset from UTC, as provided by the installed callback function and the facilities of `LocalTimeOffset`&period;
| xref:BloombergLP/bdlt/CurrentTime/currentTimeCallback-0c.adoc[`currentTimeCallback`] 
| Return the installed function used to retrieve the interval between `EpochUtil&colon;&colon;epoch()` and the current date&sol;time,
| xref:BloombergLP/bdlt/CurrentTime/currentTimeDefault.adoc[`currentTimeDefault`] 
| Return the `TimeInterval` value between `EpochUtil&colon;&colon;epoch()` and the current date&sol;time&period; This is the default current&hyphen;time callback implementation for current time retrieval&period; The obtained time is expressed as a time interval from `00&colon;00 UTC, January 1, 1970`&period; The resolution is&colon; &ast; Unix DG&hyphen;Unix&colon; microsecond resolution
| xref:BloombergLP/bdlt/CurrentTime/local.adoc[`local`] 
| Return the `Datetime` value representing the current date&sol;time in the local time zone, as provided by the installed callback function and the facilities of `LocalTimeOffset`&period;
| xref:BloombergLP/bdlt/CurrentTime/now.adoc[`now`] 
| Return the `TimeInterval` value between `EpochUtil&colon;&colon;epoch()` and the current date&sol;time as provided by the installed callback function&period; Note that this value is independent of time zone&period;
| xref:BloombergLP/bdlt/CurrentTime/setCurrentTimeCallback.adoc[`setCurrentTimeCallback`] 
| Set the specified `callback` as the function to be used to retrieve the interval between `EpochUtil&colon;&colon;epoch()` and the current date&sol;time, and return the previously set function&period;
| xref:BloombergLP/bdlt/CurrentTime/utc.adoc[`utc`] 
| Return the `Datetime` value representing the current date&sol;time in Coordinated Universal Time (UTC) as provided by the installed callback function&period;
|===



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