[#BloombergLP-bdlt-DateTz] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::DateTz :relfileprefix: ../../ :mrdocs: This value‐semantic class describes a date value in a particular time zone, which is indicated using an offset from UTC (in minutes). == Synopsis Declared in `<bdlt_datetz.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class DateTz; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlt/DateTz/2constructor-07.adoc[`DateTz`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlt/DateTz/2destructor.adoc[`~DateTz`] [.small]#[destructor]# | Destroy this object. | xref:BloombergLP/bdlt/DateTz/operator_assign.adoc[`operator=`] | Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object. | xref:BloombergLP/bdlt/DateTz/bdexStreamIn.adoc[`bdexStreamIn`] | Assign to this object the value read from the specified input `stream` using the specified `version` format, and return a reference to `stream`. If `stream` is initially invalid, this operation has no effect. If `version` is not supported, this object is unaltered and `stream` is invalidated, but otherwise unmodified. If `version` is supported but `stream` becomes invalid during this operation, this object has an undefined, but valid, state. Note that no version is read from `stream`. See the `bslx` package‐level documentation for more information on BDEX streaming of value‐semantic types and containers. | xref:BloombergLP/bdlt/DateTz/bdexStreamOut.adoc[`bdexStreamOut`] | Write the value of this object, using the specified `version` format, to the specified output `stream`, and return a reference to `stream`. If `stream` is initially invalid, this operation has no effect. If `version` is not supported, `stream` is invalidated, but otherwise unmodified. Note that `version` is not written to `stream`. See the `bslx` package‐level documentation for more information on BDEX streaming of value‐semantic types and containers. | xref:BloombergLP/bdlt/DateTz/gmtStartTime.adoc[`gmtStartTime`] | Return a `Datetime` object having the value of the UTC "point in time" when the local date starts (i.e., 0000 hours local time). The behavior is undefined unless the local date starting time represents a valid `Datetime` value for the UTC timezone. Note that the returned value is equal to: ` Datetime(localDate()).addMinutes(‐offset()); ` | xref:BloombergLP/bdlt/DateTz/localDate.adoc[`localDate`] | Return a `Date` object having the value of the local date represented by this object. Note that this is the `Date` supplied at construction and may not correspond to the actual time zone offset of the local system. | xref:BloombergLP/bdlt/DateTz/offset.adoc[`offset`] | Return the time zone offset of this `DateTz` object. Note that the offset is in minutes from UTC. | xref:BloombergLP/bdlt/DateTz/print.adoc[`print`] | Write the value of this object to the specified output `stream` in a human‐readable format, and return a reference to `stream`. Optionally specify an initial indentation `level`, whose absolute value is incremented recursively for nested objects. If `level` is specified, optionally specify `spacesPerLevel`, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects. If `level` is negative, suppress indentation of the first line. If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`). If `stream` is not valid on entry, this operation has no effect. Note that the format is not fully specified, and can change without notice. | xref:BloombergLP/bdlt/DateTz/setDateTz.adoc[`setDateTz`] | Set the local date and the time zone offset of this object to the specified `localDate` and `offset` values respectively. The behavior is undefined unless `offset` is in the range `( ‐1440 .. 1440 )`. Note that this method provides no validation, and it is the user's responsibility to assure the consistency of the resulting value. | xref:BloombergLP/bdlt/DateTz/setDateTzIfValid.adoc[`setDateTzIfValid`] | Set the local date and time zone offset of this object to the specified `localDate` and `offset` values respectively if `localDate` and `offset` represent a valid `DateTz` value. Return 0 on success, and a non‐zero value with no effect on this `DateTz` object otherwise. | xref:BloombergLP/bdlt/DateTz/utcStartTime.adoc[`utcStartTime`] | Return a `Datetime` object having the value of the UTC "point in time" when the local date starts (i.e., 0000 hours local time). The behavior is undefined unless the local date starting time represents a valid `Datetime` value for the UTC timezone. Note that the returned value is equal to: ` Datetime(localDate()).addMinutes(‐offset()); ` | xref:BloombergLP/bdlt/DateTz/validateAndSetDateTz.adoc[`validateAndSetDateTz`] | Set the local date and time zone offset of this object to the specified `localDate` and `offset` values respectively if `localDate` and `offset` represent a valid `DateTz` value. Return 0 on success, and a non‐zero value with no effect on this `DateTz` object otherwise. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlt/DateTz/isValid.adoc[`isValid`] | Return `true` if the specified `localDate` and the specified time zone `offset` represent a valid `DateTz` value, and `false` otherwise. A `localDate` and `offset` represent a valid `DateTz` value if `offset` is in the range `( ‐1440 .. 1440 )`. Note that a `true` result from this function does not guarantee that `offset` corresponds to any geographical or historical time zone. Also note that a `true` result from this function does not guarantee that `localDate` itself is a valid `Date` object. | xref:BloombergLP/bdlt/DateTz/maxSupportedBdexVersion-03.adoc[`maxSupportedBdexVersion`] | `maxSupportedBdexVersion` overloads |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlt/operator_not_eq-098.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` `DateTz` objects do not have the same value, and `false` otherwise. Two `DateTz` objects do not have the same value if they do not have the same local date values or the same time zone offset values. | xref:BloombergLP/bdlt/operator_eq-000.adoc[`operator==`] | Return `true` if the specified `lhs` and `rhs` `DateTz` objects have the same value, and `false` otherwise. Two `DateTz` objects have the same value if they have the same local date value and the same time zone offset value. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#