BLPAPI C++  3.24.11
Datetime Class Reference

#include <blpapi_datetime.h>

Classes

struct  Microseconds
 
struct  Milliseconds
 
struct  Nanoseconds
 
struct  Offset
 
struct  Picoseconds
 

Public Types

typedef blpapi_HighPrecisionDatetime_t HighPrecision
 

Public Member Functions

 Datetime ()
 
 Datetime (const Datetime &original)
 
 Datetime (const blpapi_Datetime_t &rawValue)
 
 Datetime (const blpapi_HighPrecisionDatetime_t &rawValue)
 
 Datetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds)
 
 Datetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, unsigned milliseconds)
 
 Datetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Milliseconds fractionOfSecond)
 
 Datetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Microseconds fractionOfSecond)
 
 Datetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Nanoseconds fractionOfSecond)
 
 Datetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Picoseconds fractionOfSecond)
 
 Datetime (unsigned year, unsigned month, unsigned day)
 
 Datetime (unsigned hours, unsigned minutes, unsigned seconds, unsigned milliseconds)
 
 Datetime (unsigned hours, unsigned minutes, unsigned seconds, Milliseconds fractionOfSecond)
 
 Datetime (unsigned hours, unsigned minutes, unsigned seconds, Microseconds fractionOfSecond)
 
 Datetime (unsigned hours, unsigned minutes, unsigned seconds, Nanoseconds fractionOfSecond)
 
 Datetime (unsigned hours, unsigned minutes, unsigned seconds, Picoseconds fractionOfSecond)
 
Datetimeoperator= (const Datetime &rhs)
 
void setDate (unsigned year, unsigned month, unsigned day)
 
void setTime (unsigned hours, unsigned minutes, unsigned seconds)
 
void setTime (unsigned hours, unsigned minutes, unsigned seconds, unsigned milliseconds)
 
void setTime (unsigned hours, unsigned minutes, unsigned seconds, Milliseconds fractionOfSecond)
 
void setTime (unsigned hours, unsigned minutes, unsigned seconds, Microseconds fractionOfSecond)
 
void setTime (unsigned hours, unsigned minutes, unsigned seconds, Nanoseconds fractionOfSecond)
 
void setTime (unsigned hours, unsigned minutes, unsigned seconds, Picoseconds fractionOfSecond)
 
void setOffset (short minutesAheadOfUTC)
 
void setYear (unsigned value)
 
void setMonth (unsigned value)
 
void setDay (unsigned value)
 
void setHours (unsigned value)
 
void setMinutes (unsigned value)
 
void setSeconds (unsigned value)
 
void setMilliseconds (unsigned milliseconds)
 
void setFractionOfSecond (Milliseconds value)
 
void setFractionOfSecond (Microseconds value)
 
void setFractionOfSecond (Nanoseconds value)
 
void setFractionOfSecond (Picoseconds value)
 
blpapi_Datetime_trawValue ()
 
blpapi_HighPrecisionDatetime_trawHighPrecisionValue ()
 
bool hasParts (unsigned parts) const
 
unsigned parts () const
 
unsigned year () const
 
unsigned month () const
 
unsigned day () const
 
unsigned hours () const
 
unsigned minutes () const
 
unsigned seconds () const
 
unsigned milliSeconds () const
 
unsigned milliseconds () const
 
unsigned microseconds () const
 
unsigned nanoseconds () const
 
unsigned long long picoseconds () const
 
short offset () const
 
const blpapi_Datetime_trawValue () const
 
const blpapi_HighPrecisionDatetime_trawHighPrecisionValue () const
 
const HighPrecisionhighPrecisionValue () const
 
bool isValid () const
 
std::ostream & print (std::ostream &stream, int level=0, int spacesPerLevel=4) const
 

Static Public Member Functions

static bool isValidDate (int year, int month, int day)
 
static bool isValidTime (int hours, int minutes, int seconds)
 
static bool isValidTime (int hours, int minutes, int seconds, int milliSeconds)
 
static bool isValidTime (int hours, int minutes, int seconds, Milliseconds fractionOfSecond)
 
static bool isValidTime (int hours, int minutes, int seconds, Microseconds fractionOfSecond)
 
static bool isValidTime (int hours, int minutes, int seconds, Nanoseconds fractionOfSecond)
 
static bool isValidTime (int hours, int minutes, int seconds, Picoseconds fractionOfSecond)
 
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds)
 
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Offset offset)
 
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Milliseconds fractionOfSecond)
 
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Microseconds fractionOfSecond)
 
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Nanoseconds fractionOfSecond)
 
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Picoseconds fractionOfSecond)
 
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Milliseconds fractionOfSecond, Offset offset)
 
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Microseconds fractionOfSecond, Offset offset)
 
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Nanoseconds fractionOfSecond, Offset offset)
 
static Datetime createDatetime (unsigned year, unsigned month, unsigned day, unsigned hours, unsigned minutes, unsigned seconds, Picoseconds fractionOfSecond, Offset offset)
 
static Datetime createDate (unsigned year, unsigned month, unsigned day)
 
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds)
 
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Offset offset)
 
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, unsigned milliseconds)
 
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, unsigned milliseconds, Offset offset)
 
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Milliseconds fractionOfSecond)
 
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Microseconds fractionOfSecond)
 
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Nanoseconds fractionOfSecond)
 
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Picoseconds fractionOfSecond)
 
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Milliseconds fractionOfSecond, Offset offset)
 
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Microseconds fractionOfSecond, Offset offset)
 
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Nanoseconds fractionOfSecond, Offset offset)
 
static Datetime createTime (unsigned hours, unsigned minutes, unsigned seconds, Picoseconds fractionOfSecond, Offset offset)
 

Detailed Description

Represents a date and/or time.

Datetime can represent a date and/or a time or any combination of the components of a date and time. The value is represented as eight parts which can be set or queried independently.

These parts are: year; month (from January as 1 to December as 12); day (of month, from 1 to 31); hour (from 0 to 23); minute (0 to 59); second (0 to 59); fraction-of-second (logically representing arbitrary precision, with the current interface providing picosecond resolution); and offset (time zone as minutes ahead of UTC).

Methods are provided to set and query the parts individually and in groups, e.g. setDate() and setTime(). It is also possible to determine which parts of the Datetime have been set (via the parts() method).

See Component blpapi_datetime

Member Typedef Documentation

◆ HighPrecision

Constructor & Destructor Documentation

◆ Datetime() [1/16]

Datetime ( )

Construct a Datetime object with all parts unset.

◆ Datetime() [2/16]

Datetime ( const Datetime original)

Copy constructor.

◆ Datetime() [3/16]

Datetime ( const blpapi_Datetime_t rawValue)
explicit

◆ Datetime() [4/16]

Datetime ( const blpapi_HighPrecisionDatetime_t rawValue)
explicit

◆ Datetime() [5/16]

Datetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds 
)

Create a Datetime object having the value representing the specified year, month, day, hours, minutes, and seconds parts. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function, and hours, minutes, and seconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by DATE and TIME set, and the OFFSET and FRACSECONDS parts unset. Use of this function is discouraged; use createDatetime instead.

◆ Datetime() [6/16]

Datetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
unsigned  milliseconds 
)

Create a Datetime object having the value representing the specified year, month, day, hours, minutes, seconds, and milliseconds. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function, and hours, minutes, seconds, and milliseconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by DATE and TIMEFRACSECONDS set, and the OFFSET part unset. Use of this function is discouraged; use createDatetime instead.

◆ Datetime() [7/16]

Datetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Milliseconds  fractionOfSecond 
)

◆ Datetime() [8/16]

Datetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Microseconds  fractionOfSecond 
)

◆ Datetime() [9/16]

Datetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Nanoseconds  fractionOfSecond 
)

◆ Datetime() [10/16]

Datetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Picoseconds  fractionOfSecond 
)

Create a Datetime object having the value representing the specified year, month, day, hours, minutes, seconds, and fractionOfSecond. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function, and hours, minutes, seconds, and fractionOfSecond represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by DATE and TIMEFRACSECONDS set, and the OFFSET part unset. Use of these functions is discouraged; use createDatetime instead.

◆ Datetime() [11/16]

Datetime ( unsigned  year,
unsigned  month,
unsigned  day 
)

Create a Datetime object having the value representing the specified year, month, and day. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function. The resulting Datetime object has the parts specified by DATE set, and all other parts unset.

Note that constructing a Datetime from three integers produces a date; to create a time from hour, minute, and second (without the fraction-of-second part unset) use createTime(). Use of this function is discouraged; use createDate() instead.

◆ Datetime() [12/16]

Datetime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
unsigned  milliseconds 
)

Create a Datetime object having the value representing the specified hours, minutes, seconds, and milliseconds. The behavior is undefined unless hours, minutes, seconds, and milliseconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIMEFRACSECONDS set, and all other parts unset. Note that removing the final argument from a call to this function results in a constructor creating a date, not a time.

◆ Datetime() [13/16]

Datetime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Milliseconds  fractionOfSecond 
)

◆ Datetime() [14/16]

Datetime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Microseconds  fractionOfSecond 
)

◆ Datetime() [15/16]

Datetime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Nanoseconds  fractionOfSecond 
)

◆ Datetime() [16/16]

Datetime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Picoseconds  fractionOfSecond 
)

Create a Datetime object having the value representing the specified hours, minutes, seconds, and fractionOfSecond. The behavior is undefined unless hours, minutes, seconds, and fractionOfSecond represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIMEFRACSECONDS set, and all other parts unset. Note that removing the final argument from a call to this function results in a constructor creating a date, not a time.

Member Function Documentation

◆ createDate()

Datetime createDate ( unsigned  year,
unsigned  month,
unsigned  day 
)
static

Create a Datetime object having the value representing the specified year, month, and day. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function. The resulting Datetime object has the parts specified by DATE set, and all other parts unset.

◆ createDatetime() [1/10]

Datetime createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds 
)
static

Create a Datetime object having the value representing the specified year, month, day, hours, minutes, and seconds parts. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function, and hours, minutes, and seconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by DATE and TIME set, and the OFFSET and FRACSECONDS parts unset.

◆ createDatetime() [2/10]

Datetime createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Offset  offset 
)
static

Create a Datetime object having the value representing the specified year, month, day, hours, minutes, seconds, and offset parts. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function, and hours, minutes, and seconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by DATE, TIME, and OFFSET set, and the FRACSECONDS part unset.

◆ createDatetime() [3/10]

Datetime createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Milliseconds  fractionOfSecond 
)
static

◆ createDatetime() [4/10]

Datetime createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Microseconds  fractionOfSecond 
)
static

◆ createDatetime() [5/10]

Datetime createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Nanoseconds  fractionOfSecond 
)
static

◆ createDatetime() [6/10]

Datetime createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Picoseconds  fractionOfSecond 
)
static

Create a Datetime object having the value representing the specified year, month, day, hours, minutes, seconds, and fractionOfSecond. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function, and hours, minutes, seconds, and fractionOfSecond represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by DATE and TIMEFRACSECONDS set, and the OFFSET part unset.

◆ createDatetime() [7/10]

Datetime createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Milliseconds  fractionOfSecond,
Offset  offset 
)
static

◆ createDatetime() [8/10]

Datetime createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Microseconds  fractionOfSecond,
Offset  offset 
)
static

◆ createDatetime() [9/10]

Datetime createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Nanoseconds  fractionOfSecond,
Offset  offset 
)
static

◆ createDatetime() [10/10]

Datetime createDatetime ( unsigned  year,
unsigned  month,
unsigned  day,
unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Picoseconds  fractionOfSecond,
Offset  offset 
)
static

Create a Datetime object having the value representing the specified year, month, day, hours, minutes, seconds, fractionOfSecond, and offset. The behavior is undefined unless year, month, and day represent a valid date as specified by the isValidDate function, and hours, minutes, seconds, and fractionOfSecond represent a valid time as specified by the isValidTime function. The resulting Datetime object has all parts set.

◆ createTime() [1/12]

Datetime createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds 
)
static

Create a Datetime object having the value representing the specified hours, minutes, and seconds. The behavior is undefined unless hours, minutes, and seconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIME set, and all other parts unset. Note that the FRACSECONDS part is unset.

◆ createTime() [2/12]

Datetime createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Offset  offset 
)
static

Create a Datetime object having the value representing the specified hours, minutes, seconds, and offset. The behavior is undefined unless hours, minutes, and seconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIME and OFFSET set, and all other parts unset. Note that the FRACSECONDS part is unset.

◆ createTime() [3/12]

Datetime createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
unsigned  milliseconds 
)
static
Create a <code>Datetime</code> object having the value representing

the specified hours, minutes, seconds, and milliseconds. The behavior is undefined unless hours, minutes, seconds, and milliseconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIMEFRACSECONDS set, and all other parts unset.

◆ createTime() [4/12]

Datetime createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
unsigned  milliseconds,
Offset  offset 
)
static

Create a Datetime object having the value representing the specified hours, minutes, seconds, milliseconds, and offset. The behavior is undefined unless hours, minutes, seconds, and milliseconds represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIMEFRACSECONDS and OFFSET set, and all other parts unset.

◆ createTime() [5/12]

Datetime createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Milliseconds  fractionOfSecond 
)
static

◆ createTime() [6/12]

Datetime createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Microseconds  fractionOfSecond 
)
static

◆ createTime() [7/12]

Datetime createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Nanoseconds  fractionOfSecond 
)
static

◆ createTime() [8/12]

Datetime createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Picoseconds  fractionOfSecond 
)
static

Create a Datetime object having the value representing the specified hours, minutes, seconds, and fractionOfSecond. The behavior is undefined unless hours, minutes, seconds, and fractionOfSecond represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIMEFRACSECONDS set, and all other parts unset.

◆ createTime() [9/12]

Datetime createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Milliseconds  fractionOfSecond,
Offset  offset 
)
static

◆ createTime() [10/12]

Datetime createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Microseconds  fractionOfSecond,
Offset  offset 
)
static

◆ createTime() [11/12]

Datetime createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Nanoseconds  fractionOfSecond,
Offset  offset 
)
static

◆ createTime() [12/12]

Datetime createTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Picoseconds  fractionOfSecond,
Offset  offset 
)
static

Create a Datetime object having the value representing the specified hours, minutes, seconds, fractionOfSecond, and offset. The behavior is undefined unless hours, minutes, seconds, and fractionOfSecond represent a valid time as specified by the isValidTime function. The resulting Datetime object has the parts specified by TIMEFRACSECONDS and OFFSET set, and all other parts unset.

◆ day()

unsigned day ( ) const

Return the day value of this Datetime object. The result is undefined unless the DAY part of this object is set.

◆ hasParts()

bool hasParts ( unsigned  parts) const

Return true if this Datetime object has all of the specified parts set. The parts parameter must be constructed by or'ing together values from the DatetimeParts enum.

◆ highPrecisionValue()

const Datetime::HighPrecision & highPrecisionValue ( ) const

Return a (read-only) reference to the high-precision C struct underlying this object.

◆ hours()

unsigned hours ( ) const

Return the hours value of this Datetime object. The result is undefined unless the HOURS part of this object is set.

◆ isValid()

bool isValid ( ) const

Check whether the value of this Datetime is valid. The behaviour is undefined unless this object represents a date (has YEAR, MONTH and DAY part set) or time (has HOURS, MINUTES, SECONDS and MILLISECONDS part set). Note that in almost all cases where this function returns false, prior member function calls have had undefined behavior. This function is deprecated; use isValidDate and/or isValidTime directly instead.

◆ isValidDate()

bool isValidDate ( int  year,
int  month,
int  day 
)
static

Return true if the specified year, month, and day represent a valid calendar date, and false otherwise. Note that many functions within Datetime provide defined behavior only when valid dates are provided as arguments.

◆ isValidTime() [1/6]

bool isValidTime ( int  hours,
int  minutes,
int  seconds 
)
static

◆ isValidTime() [2/6]

bool isValidTime ( int  hours,
int  minutes,
int  seconds,
int  milliSeconds 
)
static

◆ isValidTime() [3/6]

bool isValidTime ( int  hours,
int  minutes,
int  seconds,
Milliseconds  fractionOfSecond 
)
static

◆ isValidTime() [4/6]

bool isValidTime ( int  hours,
int  minutes,
int  seconds,
Microseconds  fractionOfSecond 
)
static

◆ isValidTime() [5/6]

bool isValidTime ( int  hours,
int  minutes,
int  seconds,
Nanoseconds  fractionOfSecond 
)
static

◆ isValidTime() [6/6]

bool isValidTime ( int  hours,
int  minutes,
int  seconds,
Picoseconds  fractionOfSecond 
)
static

Return true if the specified hours, minutes, seconds, and (optionally specified) milliseconds or fractionOfSecond represent a valid time of day, and false otherwise. Note that many functions within Datetime provide defined behavior only when valid times are provided as arguments.

◆ microseconds()

unsigned microseconds ( ) const

Return the fraction-of-a-second value of this object in units of whole microseconds. The result is undefined unless the FRACSECONDS part of this object is set.

◆ milliSeconds()

unsigned milliSeconds ( ) const

Return the fraction-of-a-second value of this object in units of whole milliseconds. The result is undefined unless the FRACSECONDS part of this object is set. This function is deprecated; use milliseconds() instead.

◆ milliseconds()

unsigned milliseconds ( ) const

Return the fraction-of-a-second value of this object in units of whole milliseconds. The result is undefined unless the FRACSECONDS part of this object is set.

◆ minutes()

unsigned minutes ( ) const

Return the minutes value of this Datetime object. The result is undefined unless the MINUTES part of this object is set.

◆ month()

unsigned month ( ) const

Return the month value of this Datetime object. The result is undefined unless the MONTH part of this object is set.

◆ nanoseconds()

unsigned nanoseconds ( ) const

Return the fraction-of-a-second value of this object in units of whole nanoseconds. The result is undefined unless the FRACSECONDS part of this object is set.

◆ offset()

short offset ( ) const

Return the number of minutes this Datetime object is ahead of UTC. The result is undefined unless the OFFSET part of this object is set.

◆ operator=()

Datetime & operator= ( const Datetime rhs)

Assignment operator.

◆ parts()

unsigned parts ( ) const

Return a bitmask of all parts that are set in this Datetime object. This can be compared to the values in the DatetimeParts enum using bitwise operations.

◆ picoseconds()

unsigned long long picoseconds ( ) const

Return the fraction-of-a-second value of this object in units of whole picoseconds. The result is undefined unless the FRACSECONDS part of this object is set.

◆ print()

std::ostream & print ( std::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const

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 this human-readable format is not fully specified, and can change without notice.

◆ rawHighPrecisionValue() [1/2]

blpapi_HighPrecisionDatetime_t & rawHighPrecisionValue ( )

Return a (modifiable) reference to the high-resolution C struct underlying this object. Behavior of the object is undefined if the returned struct is modified concurrently with other non-const methods of this object, or if the fields of the blpapi_HighPrecisionDatetime_t are modified such that the Datetime::isValid* methods of this class would return false when passed those fields of the struct whose bits are set in the struct's parts field.

◆ rawHighPrecisionValue() [2/2]

const blpapi_HighPrecisionDatetime_t & rawHighPrecisionValue ( ) const

Return a (read-only) reference to the high-precision C struct underlying this object.

◆ rawValue() [1/2]

blpapi_Datetime_t & rawValue ( )

Return a (modifiable) reference to the millisecond-resolution C struct underlying this object. Behavior of the object is undefined if the returned struct is modified concurrently with other non-const methods of this object, or if the fields of the blpapi_Datetime_t are modified such that the Datetime::isValid methods of this class would return false when passed those fields of the struct whose bits are set in the struct's parts field. Further, direct setting of the FRACSECONDS bit in the returned struct's parts field will cause this Datetime object to compute its fraction-of-second part not just from the struct's milliSeconds field, but also from the picoseconds field of the the struct returned from rawHighPrecisionValue(); if neither that field nor this Datetime objects' fraction-of-second part have been initialized, then the behavior of setting the FRACSECONDS bit directly is undefined.

◆ rawValue() [2/2]

const blpapi_Datetime_t & rawValue ( ) const

Return a (read-only) reference to the millisecond-resolution C struct underlying this object.

◆ seconds()

unsigned seconds ( ) const

Return the seconds value of this Datetime object. The result is undefined unless the SECONDS part of this object is set.

◆ setDate()

void setDate ( unsigned  year,
unsigned  month,
unsigned  day 
)

Set the DATE parts of this Datetime object to the specified year, month, and day. The behavior is undefined unless isValidDate(year, month, day) would return true.

◆ setDay()

void setDay ( unsigned  value)

Set the DAY part of this Datetime object to the specified value. The behavior is undefined unless 1 <= value <= 31, and either the MONTH part is not set, the YEAR part is not set, or isValidDate(this->year(). this->month(), value) == true.

◆ setFractionOfSecond() [1/4]

void setFractionOfSecond ( Milliseconds  value)

Set the FRACSECONDS part of this Datetime object to the specified value. The behavior is undefined unless 0 <= value <= 999 ms.

◆ setFractionOfSecond() [2/4]

void setFractionOfSecond ( Microseconds  value)

Set the FRACSECONDS part of this Datetime object to the specified value. The behavior is undefined unless 0 <= value <= 999,999 us.

◆ setFractionOfSecond() [3/4]

void setFractionOfSecond ( Nanoseconds  value)

Set the FRACSECONDS part of this Datetime object to the specified value. The behavior is undefined unless 0 <= value <= 999,999,999 ns.

◆ setFractionOfSecond() [4/4]

void setFractionOfSecond ( Picoseconds  value)

Set the FRACSECONDS part of this Datetime object to the specified value. The behavior is undefined unless 0 <= value <= 999,999,999,999 ps.

◆ setHours()

void setHours ( unsigned  value)

Set the HOURS part of this Datetime object to the specified value. The behavior is undefined unless 0 <= value <= 23.

◆ setMilliseconds()

void setMilliseconds ( unsigned  milliseconds)

Set the FRACSECONDS part of this Datetime object to the specified milliseconds. The behavior is undefined unless 0 <= value <= 999.

◆ setMinutes()

void setMinutes ( unsigned  value)

Set the MINUTES part of this Datetime object to the specified value. The behavior is undefined unless 0 <= value <= 59.

◆ setMonth()

void setMonth ( unsigned  value)

Set the MONTH part of this Datetime object to the specified value. The behavior is undefined unless 1 <= value <= 12, and either the DAY part is not set, the YEAR part is not set, or isValidDate(this->year(). value, this->day()) == true.

◆ setOffset()

void setOffset ( short  minutesAheadOfUTC)

Set the OFFSET (i.e. timezone) part of this Datetime object to the specified minutesAheadOfUTC. The behavior is undefined unless -840 <= minutesAheadOfUTC <= 840.

◆ setSeconds()

void setSeconds ( unsigned  value)

Set the SECONDS part of this Datetime object to the specified value. The behavior is undefined unless 0 <= value <= 59.

◆ setTime() [1/6]

void setTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds 
)

Set the TIME parts of this Datetime object to the specified hours, minutes, and seconds, and mark the FRACSECONDS part of this Datetime as unset. The behavior is undefined unless isValidTime(hours, minutes, seconds) would return true.

◆ setTime() [2/6]

void setTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
unsigned  milliseconds 
)

Set the TIMEFRACSECONDS parts of this Datetime object to the specified hours, minutes, seconds, and milliseconds. The behavior is undefined unless isValidTime(hours, minutes, seconds, milliseconds) would return true.

◆ setTime() [3/6]

void setTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Milliseconds  fractionOfSecond 
)

◆ setTime() [4/6]

void setTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Microseconds  fractionOfSecond 
)

◆ setTime() [5/6]

void setTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Nanoseconds  fractionOfSecond 
)

◆ setTime() [6/6]

void setTime ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
Picoseconds  fractionOfSecond 
)

Set the TIMEFRACSECONDS parts of this Datetime object to the specified hours, minutes, seconds, and fractionOfSecond. The behavior is undefined unless isValidTime(hours, minutes, seconds, fractionOfSecond) would return true.

◆ setYear()

void setYear ( unsigned  value)
Set the <code>YEAR</code> part of this <code>Datetime</code> object

to the specified value. The behavior is undefined unless 1 <= value <= 9999, and either the MONTH part is not set, the DAY part is not set, or isValidDate(value. this->month(), this->day()) == true.

◆ year()

unsigned year ( ) const

Return the year value of this Datetime object. The result is undefined unless the YEAR part of this object is set.


The documentation for this class was generated from the following file: