A date data value.
More...
#include <Date.hpp>
|
struct | raw_t |
| Marker struct for the raw timestamp constructor. More...
|
|
|
| Date () noexcept |
| Default constructor.
|
|
| Date (int32_t year, std::int16_t month, std::int16_t day) noexcept |
| Creates a date value.
|
|
| Date (hyper_date_t rawDate, raw_t) noexcept |
| Creates a date value from a raw date value (i.e., a Julian Day).
|
|
std::int16_t | getDay () const noexcept |
| Gets the day.
|
|
std::int16_t | getMonth () const noexcept |
| Gets the month.
|
|
std::int32_t | getYear () const noexcept |
| Gets the year.
|
|
std::string | toString () const |
| Gets a string representation for debugging.
|
|
hyper_date_t | getRaw () const noexcept |
| Gets the raw date value (i.e., the Julian Day).
|
|
A date data value.
- Examples
- insert_data_into_multiple_tables.cpp.
Definition at line 18 of file Date.hpp.
◆ hyperapi::Date::raw_t
struct hyperapi::Date::raw_t |
Marker struct for the raw timestamp constructor.
Definition at line 23 of file Date.hpp.
◆ Date() [1/3]
Default constructor.
Definition at line 28 of file Date.hpp.
◆ Date() [2/3]
hyperapi::Date::Date |
( |
int32_t |
year, |
|
|
std::int16_t |
month, |
|
|
std::int16_t |
day |
|
) |
| |
|
noexcept |
Creates a date value.
- Parameters
-
year | The year. To specify BC dates, you must convert the BC year to a negative year (e.g., 10 BC = -9). |
month | The month. |
day | The day. |
- Precondition
year
, month
, and day
must define a valid date after 4800 BC.
◆ Date() [3/3]
hyperapi::Date::Date |
( |
hyper_date_t |
rawDate, |
|
|
raw_t |
|
|
) |
| |
|
explicitnoexcept |
Creates a date value from a raw date value (i.e., a Julian Day).
- Parameters
-
rawDate | The raw date value. |
◆ getDay()
std::int16_t hyperapi::Date::getDay |
( |
| ) |
const |
|
noexcept |
Gets the day.
- Returns
- The day.
◆ getMonth()
std::int16_t hyperapi::Date::getMonth |
( |
| ) |
const |
|
noexcept |
Gets the month.
- Returns
- The month.
◆ getRaw()
hyper_date_t hyperapi::Date::getRaw |
( |
| ) |
const |
|
noexcept |
Gets the raw date value (i.e., the Julian Day).
- Returns
- The raw date value.
◆ getYear()
std::int32_t hyperapi::Date::getYear |
( |
| ) |
const |
|
noexcept |
Gets the year.
- Returns
- The year.
◆ toString()
std::string hyperapi::Date::toString |
( |
| ) |
const |
Gets a string representation for debugging.
- Returns
- the date in the '±YYYY-MM-DD' format
The documentation for this class was generated from the following file: