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

Value&hyphen;semantic type representing the time of day to microsecond resolution&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class Time;
----

== Description

This `class` implements a value&hyphen;semantic type that represents the time of day to a resolution of one microsecond&period; Each object of this (almost) simply constrained attribute class _always_ represents a valid time value to a resolution of one microsecond&period; The valid range for times is 00&colon;00&colon;00&period;000000 through 23&colon;59&colon;59&period;999999, except that 24&colon;00&colon;00&period;000000 represents the default&hyphen;constructed value&period; The value 24&colon;00&colon;00&period;000000 behaves, in most cases, as if it were the value 00&colon;00&colon;00&period;000000&semi; however, for all relational comparison operators, 24&colon;00&colon;00&period;000000 is not a valid argument and, therefore, would result in undefined behavior&period; Each add operation on a `Time` object returns the (signed) number of times that the 23&colon;59&colon;59&period;999999 &hyphen; 00&colon;00&colon;00&period;000000 boundary was crossed while performing the operation&period; Attempting to construct a `Time` with any attribute outside its valid range (or with an hour attribute value of 24 and any other attribute non&hyphen;zero) has undefined behavior&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlt/Time/2constructor-07.adoc[`Time`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlt/Time/operator_assign.adoc[`operator&equals;`] 
| Assign to this time object the value of the specified `rhs` object, and return a reference providing modifiable access to this object&period;
| xref:BloombergLP/bdlt/Time/addHours.adoc[`addHours`] 
| Increase this time by `hours`&semi; return midnight&hyphen;boundary crossings&period;
| xref:BloombergLP/bdlt/Time/addInterval.adoc[`addInterval`] 
| Increase this time by `interval`&semi; return midnight&hyphen;boundary crossings&period;
| xref:BloombergLP/bdlt/Time/addMicroseconds.adoc[`addMicroseconds`] 
| Increase this time by `microseconds`&semi; return midnight&hyphen;boundary crossings&period;
| xref:BloombergLP/bdlt/Time/addMilliseconds.adoc[`addMilliseconds`] 
| Increase this time by `milliseconds`&semi; return midnight&hyphen;boundary crossings&period;
| xref:BloombergLP/bdlt/Time/addMinutes.adoc[`addMinutes`] 
| Increase this time by `minutes`&semi; return midnight&hyphen;boundary crossings&period;
| xref:BloombergLP/bdlt/Time/addSeconds.adoc[`addSeconds`] 
| Increase this time by `seconds`&semi; return midnight&hyphen;boundary crossings&period;
| xref:BloombergLP/bdlt/Time/addTime.adoc[`addTime`] 
| Add the specified signed time fields&semi; return midnight&hyphen;boundary crossings&period;
| xref:BloombergLP/bdlt/Time/bdexStreamIn.adoc[`bdexStreamIn`] 
| Assign to this object the value read from the specified input stream&period;
| xref:BloombergLP/bdlt/Time/bdexStreamOut.adoc[`bdexStreamOut`] 
| Write this object to the specified output stream using BDEX&period;
| xref:BloombergLP/bdlt/Time/getTime.adoc[`getTime`] 
| Load the time&hyphen;of&hyphen;day attributes of this object into the given addresses&period;
| xref:BloombergLP/bdlt/Time/hour.adoc[`hour`] 
| Return the value of the `hour` attribute of this time object&period;
| xref:BloombergLP/bdlt/Time/microsecond.adoc[`microsecond`] 
| Return the value of the `microsecond` attribute of this time object&period;
| xref:BloombergLP/bdlt/Time/millisecond.adoc[`millisecond`] 
| Return the value of the `millisecond` attribute of this time object&period;
| xref:BloombergLP/bdlt/Time/minute.adoc[`minute`] 
| Return the value of the `minute` attribute of this time object&period;
| xref:BloombergLP/bdlt/Time/operator_plus_eq.adoc[`operator&plus;&equals;`] 
| Add to this time object the value of the specified `rhs` datetime interval, and return a reference providing modifiable access to this object&period;
| xref:BloombergLP/bdlt/Time/operator_minus_eq.adoc[`operator&hyphen;&equals;`] 
| Subtract from this time object the value of the specified `rhs` datetime interval, and return a reference providing modifiable access to this object&period;
| xref:BloombergLP/bdlt/Time/print.adoc[`print`] 
| Write this time to the specified output stream in a human&hyphen;readable form&period;
| xref:BloombergLP/bdlt/Time/printToBuffer.adoc[`printToBuffer`] 
| Write a textual representation of this time into `result`&period;
| xref:BloombergLP/bdlt/Time/second.adoc[`second`] 
| Return the value of the `second` attribute of this time object&period;
| xref:BloombergLP/bdlt/Time/setHour.adoc[`setHour`] 
| Set the hour attribute of this time object&period;
| xref:BloombergLP/bdlt/Time/setHourIfValid.adoc[`setHourIfValid`] 
| Set the hour attribute if it is in range&semi; otherwise do nothing&period;
| xref:BloombergLP/bdlt/Time/setMicrosecond.adoc[`setMicrosecond`] 
| Set the microsecond attribute of this time object&period;
| xref:BloombergLP/bdlt/Time/setMicrosecondIfValid.adoc[`setMicrosecondIfValid`] 
| Set the microsecond attribute if it is in range&semi; otherwise do nothing&period;
| xref:BloombergLP/bdlt/Time/setMillisecond.adoc[`setMillisecond`] 
| Set the millisecond attribute of this time object&period;
| xref:BloombergLP/bdlt/Time/setMillisecondIfValid.adoc[`setMillisecondIfValid`] 
| Set the millisecond attribute if it is in range&semi; otherwise do nothing&period;
| xref:BloombergLP/bdlt/Time/setMinute.adoc[`setMinute`] 
| Set the minute attribute of this time object&period;
| xref:BloombergLP/bdlt/Time/setMinuteIfValid.adoc[`setMinuteIfValid`] 
| Set the minute attribute if it is in range&semi; otherwise do nothing&period;
| xref:BloombergLP/bdlt/Time/setSecond.adoc[`setSecond`] 
| Set the second attribute of this time object&period;
| xref:BloombergLP/bdlt/Time/setSecondIfValid.adoc[`setSecondIfValid`] 
| Set the second attribute if it is in range&semi; otherwise do nothing&period;
| xref:BloombergLP/bdlt/Time/setTime.adoc[`setTime`] 
| Set this time from the specified time&hyphen;of&hyphen;day fields&period;
| xref:BloombergLP/bdlt/Time/setTimeIfValid.adoc[`setTimeIfValid`] 
| Set this time from fields if they form a valid value&semi; otherwise do nothing&period;
| xref:BloombergLP/bdlt/Time/streamOut.adoc[`streamOut`] 
| Format this time to the specified output `stream`, and return a reference to the modifiable `stream`&period;
| xref:BloombergLP/bdlt/Time/validateAndSetTime.adoc[`validateAndSetTime`] 
| Set this time from fields if they form a valid value&semi; otherwise do nothing&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlt/Time/isValid.adoc[`isValid`] 
| Return `true` if the specified fields form a valid `Time` value&period;
| xref:BloombergLP/bdlt/Time/maxSupportedBdexVersion-06.adoc[`maxSupportedBdexVersion`] 
| `maxSupportedBdexVersion` overloads
| xref:BloombergLP/bdlt/Time/maxSupportedVersion.adoc[`maxSupportedVersion`] 
| Return the most current BDEX streaming version number supported by this class&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bdlt/hashAppend-06d.adoc[BloombergLP::bdlt::hashAppend]`
| Invoke the specified `hashAlg` on the specified `Time` `object`&period;
| `xref:BloombergLP/bdlt/operator_gt-0a.adoc[BloombergLP::bdlt::operator&gt;]`
| Return `true` if `lhs` is later than `rhs`&period;
| `xref:BloombergLP/bdlt/operator_ge-0f.adoc[BloombergLP::bdlt::operator&gt;&equals;]`
| Return `true` if `lhs` is later than or equal to `rhs`&period;
| `xref:BloombergLP/bdlt/operator_le-0f.adoc[BloombergLP::bdlt::operator&lt;&equals;]`
| Return `true` if `lhs` is earlier than or equal to `rhs`&period;
| `xref:BloombergLP/bdlt/operator_lt-0a.adoc[BloombergLP::bdlt::operator&lt;]`
| Return `true` if `lhs` is earlier than `rhs`&period;
| `xref:BloombergLP/bdlt/operator_not_eq-0ad.adoc[BloombergLP::bdlt::operator!&equals;]`
| Return `true` if the two time objects do not have the same value&period;
| `xref:BloombergLP/bdlt/operator_eq-04c.adoc[BloombergLP::bdlt::operator&equals;&equals;]`
| Return `true` if the two time objects have the same value&period;
| `xref:BloombergLP/bdlt/operator_minus-003.adoc[BloombergLP::bdlt::operator&hyphen;]`
| Return a `DatetimeInterval` object initialized with the difference between the specified `lhs` and `rhs` time values&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlt/operator_plus-082.adoc[`operator&plus;`]
| Return a `Time` value that is the sum of the specified `lhs` time and the specified `rhs` datetime interval&period;
| xref:BloombergLP/bdlt/operator_plus-0b.adoc[`operator&plus;`]
| Return a `Time` value that is the sum of the specified `lhs` datetime interval and the specified `rhs` time&period;
| xref:BloombergLP/bdlt/operator_minus-03.adoc[`operator&hyphen;`]
| Return a `Time` value that is the difference between the specified `lhs` time and the specified `rhs` datetime interval&period;
| xref:BloombergLP/bdlt/operator_lt-08c.adoc[`operator&lt;`]
| Return `true` if time `lhs` is less than compactable transition `rhs`&period;
|===


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