This value-semantic class describes a time value in a particular time zone, which is indicated using an offset from UTC (in minutes).
Declared in <bdlt_timetz.h>
class TimeTz;
The offset is available via the offset method, and is defined by the relationship: localTime() - offset() == utcTime. The time and offset values are logically assumed to correspond to geographically valid values, however, this constraint is not enforced.
This class: * supports a complete set of value-semantic operations * supports BDEX streaming For terminology see bsldoc_glossary.
| Name | Description |
|---|---|
TimeTz [constructor] | Constructors |
~TimeTz [destructor] | Destroy this object. |
operator= | Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object. |
bdexStreamIn | Assign to this object the value read from the specified input stream. |
bdexStreamOut | Write this object to the specified output stream using BDEX. |
gmtTime | Return a Time object having the value of the UTC time represented by this object. Note that the returned value is equal to localTime() - offset() minutes. |
localTime | Return the local time attribute of this object. |
offset | Return the time zone offset of this object in minutes from UTC. |
print | Write this object to the specified stream in a human-readable format. |
setTimeTz | Set this object's local time and time zone offset. |
setTimeTzIfValid | Set this object's time and offset if they form a valid TimeTz. |
utcTime | Return a Time object having the value of the UTC time represented by this object. Note that the returned value is equal to localTime() - offset() minutes. |
validateAndSetTimeTz | Set this object's time and offset if they form a valid TimeTz. |
| Name | Description |
|---|---|
isValid | Return whether localTime and offset form a valid TimeTz. |
maxSupportedBdexVersion | maxSupportedBdexVersion overloads |
| Name | Description |
|---|---|
operator!= | Return whether the specified lhs and rhs do not have the same value. |
operator== | Return whether the specified lhs and rhs have the same value. |