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

A date data value. More...

#include <Date.hpp>

Classes

struct  raw_t
 Marker struct for the raw timestamp constructor. More...
 

Public Member Functions

 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).
 

Detailed Description

A date data value.

Examples
insert_data_into_multiple_tables.cpp.

Definition at line 18 of file Date.hpp.


Class Documentation

◆ hyperapi::Date::raw_t

struct hyperapi::Date::raw_t

Marker struct for the raw timestamp constructor.

Definition at line 23 of file Date.hpp.

Constructor & Destructor Documentation

◆ Date() [1/3]

hyperapi::Date::Date ( )
inlinenoexcept

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
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.

◆ 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
rawDateThe raw date value.

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: