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

This class implements a simply&hyphen;constrained value&hyphen;semantic type representing the composition of date and time values&period; Valid date values for the &quot;date&quot; part of a `Datetime` object are the same as those defined for `Date` objects&semi; similarly, valid time values for the &quot;time&quot; part of a `Datetime` object are similar to those defined for `Time` objects (but with additional precision)&period; Relational operators are disallowed on `Datetime` objects whose &quot;time&quot; part has the same value as that of a default constructed `Time` object&period;

== Synopsis

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

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

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlt/Datetime/2constructor-0f.adoc[`Datetime`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlt/Datetime/operator_assign.adoc[`operator&equals;`] 
| Assign to this object the value of the specified `rhs` object, and return a reference providing modifiable access to this object&period;
| xref:BloombergLP/bdlt/Datetime/addDays.adoc[`addDays`] 
| Add the specified number of `days` to the value of this object&period; Return a reference providing modifiable access to this object&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period; Note that this method has no effect on the &quot;time&quot; part of this object&period; Also note that `days` may be positive, 0, or negative&period;
| xref:BloombergLP/bdlt/Datetime/addDaysIfValid.adoc[`addDaysIfValid`] 
| Add the specified number of `days` to the value of this object, if the resulting value is in the valid range for a `Datetime` object&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; Note that this method has no effect on the &quot;time&quot; part of this object&period; Also note that `days` may be positive, 0, or negative&period;
| xref:BloombergLP/bdlt/Datetime/addHours.adoc[`addHours`] 
| Add the specified number of `hours` to the value of this object, adjusting the &quot;date&quot; part of the object accordingly&period; Return a reference providing modifiable access to this object&period; If `24 &equals;&equals; hour()` on entry, set the `hour` attribute to 0 before performing the addition&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period; Note that `hours` may be positive, negative, or 0&period;
| xref:BloombergLP/bdlt/Datetime/addHoursIfValid.adoc[`addHoursIfValid`] 
| Add the specified number of `hours` to the value of this object, adjusting the &quot;date&quot; part of the object accordingly, if the resulting value is in the valid range for a `Datetime` object&period; If `24 &equals;&equals; hour()` on entry, set the `hour` attribute to 0 before performing the addition&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; Note that `hours` may be positive, negative, or 0&period;
| xref:BloombergLP/bdlt/Datetime/addMicroseconds.adoc[`addMicroseconds`] 
| Add the specified number of `microseconds` to the value of this object, adjusting the &quot;date&quot; part of the object accordingly&period; Return a reference providing modifiable access to this object&period; If `24 &equals;&equals; hour()` on entry, set the `hour` attribute to 0 before performing the addition&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period; Note that `microseconds` may be positive, negative, or 0&period;
| xref:BloombergLP/bdlt/Datetime/addMicrosecondsIfValid.adoc[`addMicrosecondsIfValid`] 
| Add the specified number of `microseconds` to the value of this object, adjusting the &quot;date&quot; part of the object accordingly, if the resulting value is in the valid range for a `Datetime` object&period; If `24 &equals;&equals; hour()` on entry, set the `hour` attribute to 0 before performing the addition&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; Note that `microseconds` may be positive, negative, or 0&period;
| xref:BloombergLP/bdlt/Datetime/addMilliseconds.adoc[`addMilliseconds`] 
| Add the specified number of `milliseconds` to the value of this object, adjusting the &quot;date&quot; part of the object accordingly&period; Return a reference providing modifiable access to this object&period; If `24 &equals;&equals; hour()` on entry, set the `hour` attribute to 0 before performing the addition&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period; Note that `milliseconds` may be positive, negative, or 0&period;
| xref:BloombergLP/bdlt/Datetime/addMillisecondsIfValid.adoc[`addMillisecondsIfValid`] 
| Add the specified number of `milliseconds` to the value of this object, adjusting the &quot;date&quot; part of the object accordingly, if the resulting value is in the valid range for a `Datetime` object&period; If `24 &equals;&equals; hour()` on entry, set the `hour` attribute to 0 before performing the addition&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; Note that `milliseconds` may be positive, negative, or 0&period;
| xref:BloombergLP/bdlt/Datetime/addMinutes.adoc[`addMinutes`] 
| Add the specified number of `minutes` to the value of this object, adjusting the &quot;date&quot; part of the object accordingly&period; Return a reference providing modifiable access to this object&period; If `24 &equals;&equals; hour()` on entry, set the `hour` attribute to 0 before performing the addition&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period; Note that `minutes` may be positive, negative, or 0&period;
| xref:BloombergLP/bdlt/Datetime/addMinutesIfValid.adoc[`addMinutesIfValid`] 
| Add the specified number of `minutes` to the value of this object, adjusting the &quot;date&quot; part of the object accordingly, if the resulting value is in the valid range for a `Datetime` object&period; If `24 &equals;&equals; hour()` on entry, set the `hour` attribute to 0 before performing the addition&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; Note that `minutes` may be positive, negative, or 0&period;
| xref:BloombergLP/bdlt/Datetime/addSeconds.adoc[`addSeconds`] 
| Add the specified number of `seconds` to the value of this object, adjusting the &quot;date&quot; part of the object accordingly&period; Return a reference providing modifiable access to this object&period; If `24 &equals;&equals; hour()` on entry, set the `hour` attribute to 0 before performing the addition&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period; Note that `seconds` may be positive, negative, or 0&period;
| xref:BloombergLP/bdlt/Datetime/addSecondsIfValid.adoc[`addSecondsIfValid`] 
| Add the specified number of `seconds` to the value of this object, adjusting the &quot;date&quot; part of the object accordingly, if the resulting value is in the valid range for a `Datetime` object&period; If `24 &equals;&equals; hour()` on entry, set the `hour` attribute to 0 before performing the addition&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; Note that `seconds` may be positive, negative, or 0&period;
| xref:BloombergLP/bdlt/Datetime/addTime.adoc[`addTime`] 
| Add the specified number of `hours`, and the optionally specified number of `minutes`, `seconds`, `milliseconds`, and `microseconds` to the value of this object, adjusting the &quot;date&quot; part of this object accordingly&period; Unspecified trailing optional parameters default to 0&period; Return a reference providing modifiable access to this object&period; If `24 &equals;&equals; hour()` on entry, set the `hour` attribute to 0 before performing the addition&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period; Note that each argument independently may be positive, negative, or 0&period;
| xref:BloombergLP/bdlt/Datetime/addTimeIfValid.adoc[`addTimeIfValid`] 
| Add the specified number of `hours`, and the optionally specified number of `minutes`, `seconds`, `milliseconds`, and `microseconds` to the value of this object, adjusting the &quot;date&quot; part of this object accordingly, if the resulting value is in the valid range for a `Datetime` object&period; Unspecified trailing optional parameters default to 0&period; If `24 &equals;&equals; hour()` on entry, set the `hour` attribute to 0 before performing the addition&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; Note that each argument independently may be positive, negative, or 0&period;
| xref:BloombergLP/bdlt/Datetime/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`&period; If `stream` is initially invalid, this operation has no effect&period; If `version` is not supported, this object is unaltered and `stream` is invalidated, but otherwise unmodified&period; If `version` is supported but `stream` becomes invalid during this operation, this object has an undefined, but valid, state&period; Note that no version is read from `stream`&period; See the `bslx` package&hyphen;level documentation for more information on BDEX streaming of value&hyphen;semantic types and containers&period;
| xref:BloombergLP/bdlt/Datetime/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`&period; If `stream` is initially invalid, this operation has no effect&period; If `version` is not supported, `stream` is invalidated, but otherwise unmodified&period; Note that `version` is not written to `stream`&period; See the `bslx` package&hyphen;level documentation for more information on BDEX streaming of value&hyphen;semantic types and containers&period;
| xref:BloombergLP/bdlt/Datetime/date.adoc[`date`] 
| Return the value of the &quot;date&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/day.adoc[`day`] 
| Return the value of the `day` (of the month) attribute of this object&period;
| xref:BloombergLP/bdlt/Datetime/dayOfWeek.adoc[`dayOfWeek`] 
| Return the value of the `dayOfWeek` attribute associated with the `day` (of the month) attribute of this object&period;
| xref:BloombergLP/bdlt/Datetime/dayOfYear.adoc[`dayOfYear`] 
| Return the value of the `dayOfYear` attribute of this object&period;
| xref:BloombergLP/bdlt/Datetime/getTime.adoc[`getTime`] 
| Load, into the specified `hour`, and the optionally specified `minute`, `second`, `millisecond`, and `microsecond` the respective `hour`, `minute`, `second`, `millisecond`, and `microsecond` attribute values from this time object&period; Unspecified arguments default to 0&period; Supplying 0 for an address argument suppresses the loading of the value for the corresponding attribute, but has no effect on the loading of other attribute values&period;
| xref:BloombergLP/bdlt/Datetime/hour.adoc[`hour`] 
| Return the value of the `hour` attribute of this object&period;
| xref:BloombergLP/bdlt/Datetime/microsecond.adoc[`microsecond`] 
| Return the value of the `microsecond` attribute of this object&period;
| xref:BloombergLP/bdlt/Datetime/millisecond.adoc[`millisecond`] 
| Return the value of the `millisecond` attribute of this object&period;
| xref:BloombergLP/bdlt/Datetime/minute.adoc[`minute`] 
| Return the value of the `minute` attribute of this object&period;
| xref:BloombergLP/bdlt/Datetime/month.adoc[`month`] 
| Return the value of the `month` attribute of this object&period;
| xref:BloombergLP/bdlt/Datetime/operator_plus_eq-0a.adoc[`operator&plus;&equals;`] 
| Addition assignment operators
| xref:BloombergLP/bdlt/Datetime/operator_minus_eq-0e.adoc[`operator&hyphen;&equals;`] 
| Subtraction assignment operators
| xref:BloombergLP/bdlt/Datetime/print.adoc[`print`] 
| Write the value of this object to the specified output `stream` in a human&hyphen;readable format, and return a reference to `stream`&period; Optionally specify an initial indentation `level`, whose absolute value is incremented recursively for nested objects&period; 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&period; If `level` is negative, suppress indentation of the first line&period; If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`)&period; If `stream` is not valid on entry, this operation has no effect&period; Note that this human&hyphen;readable format is not fully specified, and can change without notice&period;
| xref:BloombergLP/bdlt/Datetime/printToBuffer.adoc[`printToBuffer`] 
| Efficiently write to the specified `result` buffer no more than the specified `numBytes` of a representation of the value of this object&period; Optionally specify `fractionalSecondPrecision` digits to indicate how many fractional second digits to output&period; If `fractionalSecondPrecision` is not specified then 6 fractional second digits will be output (3 digits for milliseconds and 3 digits for microseconds)&period; Return the number of characters (not including the null character) that would have been written if the limit due to `numBytes` were not imposed&period; `result` is null&hyphen;terminated unless `numBytes` is 0&period; The behavior is undefined unless `0 &lt;&equals; numBytes`, `0 &lt;&equals; fractionalSecondPrecision &lt;&equals; 6`, and `result` refers to at least `numBytes` contiguous bytes&period; Note that the return value is greater than or equal to `numBytes` if the output representation was truncated to avoid `result` overrun&period;
| xref:BloombergLP/bdlt/Datetime/second.adoc[`second`] 
| Return the value of the `second` attribute of this object&period;
| xref:BloombergLP/bdlt/Datetime/setDate.adoc[`setDate`] 
| Set the &quot;date&quot; part of this object to have the value of the specified `date`&period; Note that this method has no effect on the &quot;time&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/setDatetime-0f.adoc[`setDatetime`] 
| `setDatetime` overloads
| xref:BloombergLP/bdlt/Datetime/setDatetimeIfValid-03.adoc[`setDatetimeIfValid`] 
| `setDatetimeIfValid` overloads
| xref:BloombergLP/bdlt/Datetime/setHour.adoc[`setHour`] 
| Set the &quot;hour&quot; attribute of this object to the specified `hour` value&period; If `24 &equals;&equals; hour`, set the `minute`, `second`, `millisecond`, and `microsecond` attributes to 0&period; The behavior is undefined unless `0 &lt;&equals; hour &lt;&equals; 24`&period; Note that this method has no effect on the &quot;date&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/setHourIfValid.adoc[`setHourIfValid`] 
| Set the &quot;hour&quot; attribute of this object to the specified `hour` value if `0 &lt;&equals; hour &lt;&equals; 24`&period; If `24 &equals;&equals; hour`, set the `minute`, `second`, `millisecond`, and `microsecond` attributes to 0&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; Note that this method has no effect on the &quot;date&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/setMicrosecond.adoc[`setMicrosecond`] 
| Set the &quot;microsecond&quot; attribute of this object to the specified `microsecond` value&period; If `24 &equals;&equals; hour()`, set the `hour` attribute to 0&period; The behavior is undefined unless `0 &lt;&equals; microsecond &lt;&equals; 999`&period; Note that this method has no effect on the &quot;date&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/setMicrosecondIfValid.adoc[`setMicrosecondIfValid`] 
| Set the &quot;microsecond&quot; attribute of this object to the specified `microsecond` value if `0 &lt;&equals; microsecond &lt;&equals; 999`&period; If `24 &equals;&equals; hour()`, set the `hour` attribute to 0&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; Note that this method has no effect on the &quot;date&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/setMillisecond.adoc[`setMillisecond`] 
| Set the &quot;millisecond&quot; attribute of this object to the specified `millisecond` value&period; If `24 &equals;&equals; hour()`, set the `hour` attribute to 0&period; The behavior is undefined unless `0 &lt;&equals; millisecond &lt;&equals; 999`&period; Note that this method has no effect on the &quot;date&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/setMillisecondIfValid.adoc[`setMillisecondIfValid`] 
| Set the &quot;millisecond&quot; attribute of this object to the specified `millisecond` value if `0 &lt;&equals; millisecond &lt;&equals; 999`&period; If `24 &equals;&equals; hour()`, set the `hour` attribute to 0&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; Note that this method has no effect on the &quot;date&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/setMinute.adoc[`setMinute`] 
| Set the &quot;minute&quot; attribute of this object to the specified `minute` value&period; If `24 &equals;&equals; hour()`, set the `hour` attribute to 0&period; The behavior is undefined unless `0 &lt;&equals; minute &lt;&equals; 59`&period; Note that this method has no effect on the &quot;date&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/setMinuteIfValid.adoc[`setMinuteIfValid`] 
| Set the &quot;minute&quot; attribute of this object to the specified `minute` value if `0 &lt;&equals; minute &lt;&equals; 59`&period; If `24 &equals;&equals; hour()`, set the `hour` attribute to 0&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; Note that this method has no effect on the &quot;date&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/setSecond.adoc[`setSecond`] 
| Set the &quot;second&quot; attribute of this object to the specified `second` value&period; If `24 &equals;&equals; hour()`, set the `hour` attribute to 0&period; The behavior is undefined unless `0 &lt;&equals; second &lt;&equals; 59`&period; Note that this method has no effect on the &quot;date&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/setSecondIfValid.adoc[`setSecondIfValid`] 
| Set the &quot;second&quot; attribute of this object to the specified `second` value if `0 &lt;&equals; second &lt;&equals; 59`&period; If `24 &equals;&equals; hour()`, set the `hour` attribute to 0&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; Note that this method has no effect on the &quot;date&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/setTime-09.adoc[`setTime`] 
| `setTime` overloads
| xref:BloombergLP/bdlt/Datetime/setTimeIfValid.adoc[`setTimeIfValid`] 
| Set the &quot;time&quot; part of this object to have the value represented by the specified `hour` attribute value and the optionally specified `minute`, `second`, `millisecond`, and `microsecond` attribute values if they comprise a valid &quot;time&quot; portion of a `DateTime` value&period; Unspecified trailing optional parameters default to 0&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; Note that this method has no effect on the &quot;date&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/setYearDay.adoc[`setYearDay`] 
| Set the &quot;date&quot; part of this object to have the value represented by the specified `year` and `dayOfYear` attribute values&period; The behavior is undefined unless `year` and `dayOfYear` represent a valid `Date` value (i&period;e&period;, `true &equals;&equals; Date&colon;&colon;isValidYearDay(year, dayOfYear)`)&period; Note that this method has no effect on the &quot;time&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/setYearDayIfValid.adoc[`setYearDayIfValid`] 
| Set this object to have the value represented by the specified `year` and `dayOfYear` if they comprise a valid `Date` value (see `Date&colon;&colon;isValidYearDay`)&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period;
| xref:BloombergLP/bdlt/Datetime/setYearMonthDay.adoc[`setYearMonthDay`] 
| Set the &quot;date&quot; part of this object to have the value represented by the specified `year`, `month`, and `day` attribute values&period; The behavior is undefined unless `year`, `month`, and `day` represent a valid `Date` value (i&period;e&period;, `true &equals;&equals; Date&colon;&colon;isValidYearMonthDay(year, month, day)`)&period; Note that this method has no effect on the &quot;time&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/setYearMonthDayIfValid.adoc[`setYearMonthDayIfValid`] 
| Set this object to have the value represented by the specified `year`, `month`, and `day` if they comprise a valid `Date` value (see `Date&colon;&colon;isValidYearMonthDay`)&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period;
| xref:BloombergLP/bdlt/Datetime/streamOut.adoc[`streamOut`] 
| Format this datetime to the specified output `stream` and return a reference to the modifiable `stream`&period;
| xref:BloombergLP/bdlt/Datetime/time.adoc[`time`] 
| Return the value of the &quot;time&quot; part of this object&period;
| xref:BloombergLP/bdlt/Datetime/validateAndSetDatetime.adoc[`validateAndSetDatetime`] 
| Set the &quot;date&quot; part of this object&apos;s value to the specified `year`, `month`, and `day`, and the &quot;time&quot; part to the optionally specified `hour`, `minute`, `second`, and `millisecond`, if they represent a valid `Datetime` value, with trailing fields that are not specified set to 0&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period;
| xref:BloombergLP/bdlt/Datetime/year.adoc[`year`] 
| Return the value of the `year` attribute of this object&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlt/Datetime/isValid.adoc[`isValid`] 
| Return `true` if the specified `year`, `month`, and `day` attribute values, and the optionally specified `hour`, `minute`, `second`, `millisecond`, and `microsecond` attribute values, represent a valid `Datetime` value, and `false` otherwise&period; Unspecified trailing optional parameters default to 0&period; `year`, `month`, `day`, `hour`, `minute`, `second`, `millisecond`, and `microsecond` attribute values represent a valid `Datetime` value if `true &equals;&equals; Date&colon;&colon;isValidYearMonthDay(year, month, day)`, `0 &lt;&equals; hour &lt; 24`, `0 &lt;&equals; minute &lt; 60`, `0 &lt;&equals; second &lt; 60`, `0 &lt;&equals; millisecond &lt; 1000`, and `0 &lt;&equals; microsecond &lt; 1000`&period; Additionally, a valid `year`, `month`, `day` with the time portion equal to 24&colon;00&colon;00&period;000000 also represents a valid `Datetime` value&period;
| xref:BloombergLP/bdlt/Datetime/maxSupportedBdexVersion-04.adoc[`maxSupportedBdexVersion`] 
| `maxSupportedBdexVersion` overloads
| xref:BloombergLP/bdlt/Datetime/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-01.adoc[BloombergLP::bdlt::hashAppend]`
| Pass the specified `object` to the specified `hashAlg`&period; This function integrates with the `bslh` modular hashing system and effectively provides a `bsl&colon;&colon;hash` specialization for `Datetime`&period;
| `xref:BloombergLP/bdlt/operator_ge-03.adoc[BloombergLP::bdlt::operator&gt;&equals;]`
| Return `true` if the value of the specified `lhs` object is greater than or equal to the value of the specified `rhs` object, and `false` otherwise&period; The behavior is undefined unless `24 !&equals; lhs&period;hour() &amp;&amp; 24 !&equals; rhs&period;hour()`&period;
| `xref:BloombergLP/bdlt/operator_gt-02.adoc[BloombergLP::bdlt::operator&gt;]`
| Return `true` if the value of the specified `lhs` object is greater than the value of the specified `rhs` object, and `false` otherwise&period; A `Datetime` object `a` is greater than a `Datetime` object `b` if `a&period;date() &gt; b&period;date()`, or if `a&period;date() &equals;&equals; b&period;date()` and the time portion of `a` is greater than the time portion of `b`&period; The behavior is undefined unless `24 !&equals; lhs&period;hour() &amp;&amp; 24 !&equals; rhs&period;hour()`&period;
| `xref:BloombergLP/bdlt/operator_le-01.adoc[BloombergLP::bdlt::operator&lt;&equals;]`
| Return `true` if the value of the specified `lhs` object is less than or equal to the value of the specified `rhs` object, and `false` otherwise&period; The behavior is undefined unless `24 !&equals; lhs&period;hour() &amp;&amp; 24 !&equals; rhs&period;hour()`&period;
| `xref:BloombergLP/bdlt/operator_lt-0d.adoc[BloombergLP::bdlt::operator&lt;]`
| Return `true` if the value of the specified `lhs` object is less than the value of the specified `rhs` object, and `false` otherwise&period; A `Datetime` object `a` is less than a `Datetime` object `b` if `a&period;date() &lt; b&period;date()`, or if `a&period;date() &equals;&equals; b&period;date()` and the time portion of `a` is less than the time portion of `b`&period; The behavior is undefined unless `24 !&equals; lhs&period;hour() &amp;&amp; 24 !&equals; rhs&period;hour()`&period;
| `xref:BloombergLP/bdlt/operator_not_eq-02.adoc[BloombergLP::bdlt::operator!&equals;]`
| Return `true` if the specified `lhs` and `rhs` `Datetime` objects do not have the same value, and `false` otherwise&period; Two `Datetime` objects do not have the same value if they do not have the same values for either of their &quot;date&quot; or &quot;time&quot; parts, respectively&period;
| `xref:BloombergLP/bdlt/operator_eq-022.adoc[BloombergLP::bdlt::operator&equals;&equals;]`
| Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise&period; Two `Datetime` objects have the same value if they have the same values for their &quot;date&quot; and &quot;time&quot; parts, respectively&period;
| `xref:BloombergLP/bdlt/operator_minus-0c.adoc[BloombergLP::bdlt::operator&hyphen;]`
| Return a `DatetimeInterval` object having a value that is the difference between the specified `lhs` (`Datetime`) and the specified `rhs` (`Datetime`)&period; If the `hour` attribute of either operand is 24, the result is the same as if that `hour` attribute is 0&period; The behavior is undefined unless the resulting value is in the valid range for a `DatetimeInterval` object&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlt/operator_plus-069.adoc[`operator&plus;`]
| Return a `Datetime` object having a value that is the sum of the specified `lhs` (`bsls&colon;&colon;TimeInterval`) and the specified `rhs` (`Datetime`)&period; If `24 &equals;&equals; rhs&period;hour()`, the result is the same as if the `hour` attribute of `rhs` is 0&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period;
| xref:BloombergLP/bdlt/operator_plus-07.adoc[`operator&plus;`]
| Return a `Datetime` object having a value that is the sum of the specified `lhs` (`Datetime`) and the specified `rhs` (`bsls&colon;&colon;TimeInterval`)&period; If `24 &equals;&equals; lhs&period;hour()`, the result is the same as if the `hour` attribute of `lhs` is 0&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period;
| xref:BloombergLP/bdlt/operator_plus-087.adoc[`operator&plus;`]
| Return a `Datetime` object having a value that is the sum of the specified `lhs` (`DatetimeInterval`) and the specified `rhs` (`Datetime`)&period; If `24 &equals;&equals; rhs&period;hour()`, the result is the same as if the `hour` attribute of `rhs` is 0&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period;
| xref:BloombergLP/bdlt/operator_plus-09.adoc[`operator&plus;`]
| Return a `Datetime` object having a value that is the sum of the specified `lhs` (`Datetime`) and the specified `rhs` (`DatetimeInterval`)&period; If `24 &equals;&equals; lhs&period;hour()`, the result is the same as if the `hour` attribute of `lhs` is 0&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period;
| xref:BloombergLP/bdlt/operator_minus-06.adoc[`operator&hyphen;`]
| Return a `Datetime` object having a value that is the difference between the specified `lhs` (`Datetime`) and the specified `rhs` (`bsls&colon;&colon;TimeInterval`)&period; If `24 &equals;&equals; lhs&period;hour()`, the result is the same as if the `hour` attribute of `lhs` is 0&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period;
| xref:BloombergLP/bdlt/operator_minus-07.adoc[`operator&hyphen;`]
| Return a `Datetime` object having a value that is the difference between the specified `lhs` (`Datetime`) and the specified `rhs` (`DatetimeInterval`)&period; If `24 &equals;&equals; lhs&period;hour()`, the result is the same as if the `hour` attribute of `lhs` is 0&period; The behavior is undefined unless the resulting value is in the valid range for a `Datetime` object&period;
| xref:BloombergLP/bdlt/operator_lt-034.adoc[`operator&lt;`]
| Return `true` if the specified `lhs` has a value less than the specified `rhs`, and `false` otherwise&period; Datetime `lhs` has a value less than timetable transition `rhs` if `lhs &lt; rhs&period;datetime()`&period; The behavior is undefined unless `24 &gt; lhs&period;hour()`&period;
|===


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