|
Lightweight 0.20250904.0
|
#include <SqlDateTime.hpp>
Public Types | |
| using | native_type = std::chrono::system_clock::time_point |
| using | duration_type = std::chrono::system_clock::duration |
Public Member Functions | |
| constexpr | SqlDateTime (SqlDateTime &&) noexcept=default |
| constexpr SqlDateTime & | operator= (SqlDateTime &&) noexcept=default |
| constexpr | SqlDateTime (SqlDateTime const &) noexcept=default |
| constexpr SqlDateTime & | operator= (SqlDateTime const &other) noexcept=default |
| constexpr std::weak_ordering | operator<=> (SqlDateTime const &other) const noexcept |
| constexpr bool | operator== (SqlDateTime const &other) const noexcept |
| constexpr bool | operator!= (SqlDateTime const &other) const noexcept |
| LIGHTWEIGHT_FORCE_INLINE constexpr | SqlDateTime (std::chrono::year_month_day ymd, std::chrono::hh_mm_ss< duration_type > time) noexcept |
| Constructs a date and time from individual components. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr | SqlDateTime (std::chrono::year year, std::chrono::month month, std::chrono::day day, std::chrono::hours hour, std::chrono::minutes minute, std::chrono::seconds second, std::chrono::nanoseconds nanosecond=std::chrono::nanoseconds(0)) noexcept |
| Constructs a date and time from individual components. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr | SqlDateTime (std::chrono::system_clock::time_point value) noexcept |
| Constructs a date and time from a time point. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE std::chrono::year | year () const noexcept |
| Returns the year of this date-time object. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE std::chrono::month | month () const noexcept |
| Returns the month of this date-time object. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE std::chrono::day | day () const noexcept |
| Returns the day of this date-time object. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE std::chrono::hours | hour () const noexcept |
| Returns the hour of this date-time object. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE std::chrono::minutes | minute () const noexcept |
| Returns the minute of this date-time object. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE std::chrono::seconds | second () const noexcept |
| Returns the second of this date-time object. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE std::chrono::nanoseconds | nanosecond () const noexcept |
| Returns the nanosecond of this date-time object. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr | operator native_type () const noexcept |
| constexpr LIGHTWEIGHT_FORCE_INLINE SqlDate | Date () const noexcept |
| Constructs only a date from a SQL date-time structure. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE SqlTime | Time () const noexcept |
| Constructs only a time from a SQL date-time structure. | |
| constexpr LIGHTWEIGHT_FORCE_INLINE native_type | value () const noexcept |
| Returns the current date and time. | |
| LIGHTWEIGHT_FORCE_INLINE SqlDateTime & | operator+= (duration_type duration) noexcept |
| LIGHTWEIGHT_FORCE_INLINE SqlDateTime & | operator-= (duration_type duration) noexcept |
Static Public Member Functions | |
| static LIGHTWEIGHT_FORCE_INLINE SqlDateTime | Now () noexcept |
| Returns the current date and time. | |
| static LIGHTWEIGHT_FORCE_INLINE SqlDateTime | NowUTC () noexcept |
| Return the current date and time in UTC. | |
| static LIGHTWEIGHT_FORCE_INLINE SQL_TIMESTAMP_STRUCT constexpr | ConvertToSqlValue (native_type value) noexcept |
| static LIGHTWEIGHT_FORCE_INLINE SQL_TIMESTAMP_STRUCT constexpr | ConvertToSqlValue (std::chrono::year_month_day ymd, std::chrono::hh_mm_ss< duration_type > hms) noexcept |
| static LIGHTWEIGHT_FORCE_INLINE native_type constexpr | ConvertToNative (SQL_TIMESTAMP_STRUCT const &time) noexcept |
Public Attributes | |
| SQL_TIMESTAMP_STRUCT | sqlValue {} |
Represents a date and time to efficiently write to or read from a database.
Definition at line 24 of file SqlDateTime.hpp.
| using Lightweight::SqlDateTime::native_type = std::chrono::system_clock::time_point |
Definition at line 26 of file SqlDateTime.hpp.
| using Lightweight::SqlDateTime::duration_type = std::chrono::system_clock::duration |
Definition at line 27 of file SqlDateTime.hpp.
|
inlineconstexprnoexcept |
Constructs a date and time from individual components.
Definition at line 65 of file SqlDateTime.hpp.
|
inlineconstexprnoexcept |
Constructs a date and time from individual components.
Definition at line 81 of file SqlDateTime.hpp.
References day(), hour(), minute(), month(), nanosecond(), second(), and year().
|
inlineconstexprnoexcept |
Constructs a date and time from a time point.
Definition at line 102 of file SqlDateTime.hpp.
References value().
|
inlinestaticnoexcept |
Returns the current date and time.
Definition at line 30 of file SqlDateTime.hpp.
|
inlinestaticnoexcept |
Return the current date and time in UTC.
Definition at line 37 of file SqlDateTime.hpp.
|
inlineconstexprnoexcept |
Definition at line 50 of file SqlDateTime.hpp.
|
inlineconstexprnoexcept |
Definition at line 54 of file SqlDateTime.hpp.
|
inlineconstexprnoexcept |
Definition at line 59 of file SqlDateTime.hpp.
|
inlineconstexprnoexcept |
Returns the year of this date-time object.
Definition at line 110 of file SqlDateTime.hpp.
Referenced by Date(), and SqlDateTime().
|
inlineconstexprnoexcept |
Returns the month of this date-time object.
Definition at line 116 of file SqlDateTime.hpp.
Referenced by Date(), and SqlDateTime().
|
inlineconstexprnoexcept |
Returns the day of this date-time object.
Definition at line 122 of file SqlDateTime.hpp.
Referenced by Date(), and SqlDateTime().
|
inlineconstexprnoexcept |
Returns the hour of this date-time object.
Definition at line 128 of file SqlDateTime.hpp.
Referenced by SqlDateTime(), and Time().
|
inlineconstexprnoexcept |
Returns the minute of this date-time object.
Definition at line 134 of file SqlDateTime.hpp.
Referenced by SqlDateTime(), and Time().
|
inlineconstexprnoexcept |
Returns the second of this date-time object.
Definition at line 140 of file SqlDateTime.hpp.
Referenced by SqlDateTime(), and Time().
|
inlineconstexprnoexcept |
Returns the nanosecond of this date-time object.
Definition at line 146 of file SqlDateTime.hpp.
Referenced by SqlDateTime(), and Time().
|
inlineconstexprnoexcept |
Definition at line 153 of file SqlDateTime.hpp.
|
inlineconstexprnoexcept |
Constructs only a date from a SQL date-time structure.
Definition at line 159 of file SqlDateTime.hpp.
|
inlineconstexprnoexcept |
Constructs only a time from a SQL date-time structure.
Definition at line 165 of file SqlDateTime.hpp.
References hour(), minute(), nanosecond(), and second().
|
inlinestaticconstexprnoexcept |
Definition at line 173 of file SqlDateTime.hpp.
|
inlinestaticconstexprnoexcept |
Definition at line 183 of file SqlDateTime.hpp.
|
inlinestaticconstexprnoexcept |
Definition at line 200 of file SqlDateTime.hpp.
|
inlineconstexprnoexcept |
Returns the current date and time.
Definition at line 218 of file SqlDateTime.hpp.
Referenced by SqlDateTime().
|
inlinenoexcept |
Definition at line 223 of file SqlDateTime.hpp.
|
inlinenoexcept |
Definition at line 229 of file SqlDateTime.hpp.
| SQL_TIMESTAMP_STRUCT Lightweight::SqlDateTime::sqlValue {} |
Definition at line 245 of file SqlDateTime.hpp.