Hyper API for C++ 0.0.18825
Hyper client library for C++ applications
Loading...
Searching...
No Matches
hyperapi::Date Class Referencefinal

A date data value. More...

#include <Date.hpp>

Public Member Functions

 Date () noexcept
 Default constructor.
 
 Date (int32_t year, std::int16_t month, std::int16_t day) noexcept
 Creates a date value.
 
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).
 

Detailed Description

A date data value.

Examples
insert_data_into_multiple_tables.cpp.

Definition at line 18 of file Date.hpp.

Constructor & Destructor Documentation

◆ Date() [1/2]

hyperapi::Date::Date ( )
inlinenoexcept

Default constructor.

Definition at line 23 of file Date.hpp.

◆ Date() [2/2]

hyperapi::Date::Date ( int32_t  year,
std::int16_t  month,
std::int16_t  day 
)
noexcept

Creates a date value.

Parameters
yearThe year. To specify BC dates, you must convert the BC year to a negative year (e.g., 10 BC = -9).
monthThe month.
dayThe day.
Precondition
year, month, and day must define a valid date after 4800 BC.

Member Function Documentation

◆ 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: