Value‐semantic type representing a date and a time of day.
Synopsis
Declared in <bdlt_datetime.h>
class Datetime;
Description
This class implements a simply‐constrained value‐semantic type representing the composition of date and time values. Valid date values for the "date" part of a Datetime object are the same as those defined for Date objects; similarly, valid time values for the "time" part of a Datetime object are similar to those defined for Time objects (but with additional precision). Relational operators are disallowed on Datetime objects whose "time" part has the same value as that of a default constructed Time object.
Member Functions
Name |
Description |
|
Constructors |
Assign to this object the value of the specified |
|
Add the specified number of days to this datetime. |
|
Add days if the result remains a valid datetime. |
|
Add the specified number of hours to this datetime. |
|
Add hours if the result remains a valid datetime. |
|
Add the specified number of microseconds to this datetime. |
|
Add microseconds if the result remains a valid datetime. |
|
Add the specified number of milliseconds to this datetime. |
|
Add milliseconds if the result remains a valid datetime. |
|
Add the specified number of minutes to this datetime. |
|
Add minutes if the result remains a valid datetime. |
|
Add the specified number of seconds to this datetime. |
|
Add seconds if the result remains a valid datetime. |
|
Add the specified time components to this datetime. |
|
Add time components if the result remains a valid datetime. |
|
Assign to this object the value read from the specified stream. |
|
Write this object to the specified output stream. |
|
Return the value of the "date" part of this object. |
|
Return the value of the |
|
Return the value of the |
|
Return the value of the |
|
Load this object's time attributes into the specified addresses. |
|
Return the value of the |
|
Return the value of the |
|
Return the value of the |
|
Return the value of the |
|
Return the value of the |
|
Addition assignment operators |
|
Subtraction assignment operators |
|
Write this object to the specified output stream in a readable form. |
|
Write a textual representation of this object into |
|
Return the value of the |
|
Set the "date" part of this object to have the value of the specified |
|
|
|
|
|
Set the hour attribute of this object. |
|
Set the hour attribute if it is in range. |
|
Set the microsecond attribute of this object. |
|
Set the microsecond attribute if it is in range. |
|
Set the millisecond attribute of this object. |
|
Set the millisecond attribute if it is in range. |
|
Set the minute attribute of this object. |
|
Set the minute attribute if it is in range. |
|
Set the second attribute of this object. |
|
Set the second attribute if it is in range. |
|
|
|
Set the time part from fields if they form a valid time. |
|
Set the date part from |
|
Set the date from |
|
Set the date part from |
|
Set the date from year/month/day if they form a valid date. |
|
Format this datetime to the specified output |
|
Return the value of the "time" part of this object. |
|
Set this object from calendar fields if they form a valid datetime. |
|
Return the value of the |
Static Member Functions
Name |
Description |
Return |
|
|
|
Return the most current BDEX streaming version number supported by this class. |
Friends
Name |
Description |
Invoke the specified |
|
Return |
|
Return |
|
Return |
|
Return |
|
Return |
|
Return |
|
Return the interval between two datetimes. |
Non-Member Functions
Name |
Description |
Return the sum of a time interval and a datetime. |
|
Return the sum of a datetime and a time interval. |
|
Return the sum of a datetime interval and a datetime. |
|
Return the sum of a datetime and a datetime interval. |
|
Return the difference of a datetime and a time interval. |
|
Return the difference of a datetime and a datetime interval. |
|
Return |
Created with MrDocs