A structure holding a calendar date and time broken down into its components.
More...
- Since
- This struct is available since SDL 3.2.0.
◆ DateTime() [1/3]
constexpr SDL::DateTime::DateTime |
( |
const SDL_DateTime & |
dateTime = {} | ) |
|
|
inlineconstexpr |
- Parameters
-
dateTime | the value to be wrapped |
◆ DateTime() [2/3]
constexpr SDL::DateTime::DateTime |
( |
int |
year, |
|
|
int |
month, |
|
|
int |
day, |
|
|
int |
hour, |
|
|
int |
minute, |
|
|
int |
second, |
|
|
int |
nanosecond, |
|
|
int |
day_of_week, |
|
|
int |
utc_offset |
|
) |
| |
|
inlineconstexpr |
- Parameters
-
year | the value for year. |
month | the value for month. |
day | the value for day. |
hour | the value for hour. |
minute | the value for minute. |
second | the value for second. |
nanosecond | the value for nanosecond. |
day_of_week | the value for day_of_week. |
utc_offset | the value for utc_offset. |
◆ DateTime() [3/3]
SDL::DateTime::DateTime |
( |
Time |
ticks, |
|
|
bool |
localTime = true |
|
) |
| |
|
inline |
- Parameters
-
ticks | the Time to be converted. |
localTime | the resulting DateTime will be expressed in local time if true, otherwise it will be in Universal Coordinated Time (UTC). |
- Exceptions
-
- Since
- This function is available since SDL 3.2.0.
◆ GetDay()
constexpr int SDL::DateTime::GetDay |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- current day value.
◆ GetDay_of_week()
constexpr int SDL::DateTime::GetDay_of_week |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- current day_of_week value.
◆ GetHour()
constexpr int SDL::DateTime::GetHour |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- current hour value.
◆ GetMinute()
constexpr int SDL::DateTime::GetMinute |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- current minute value.
◆ GetMonth()
constexpr int SDL::DateTime::GetMonth |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- current month value.
◆ GetNanosecond()
constexpr int SDL::DateTime::GetNanosecond |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- current nanosecond value.
◆ GetSecond()
constexpr int SDL::DateTime::GetSecond |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- current second value.
◆ GetUtc_offset()
constexpr int SDL::DateTime::GetUtc_offset |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- current utc_offset value.
◆ GetYear()
constexpr int SDL::DateTime::GetYear |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- current year value.
◆ operator bool()
constexpr SDL::DateTime::operator bool |
( |
| ) |
const |
|
inlineexplicitconstexpr |
- Returns
- True if valid state, false otherwise.
◆ operator Time()
SDL::DateTime::operator Time |
( |
| ) |
const |
|
inline |
This function ignores the day_of_week member of the DateTime struct, so it may remain unset.
- Returns
- time on success.
- Exceptions
-
- Since
- This function is available since SDL 3.2.0.
◆ SetDay()
constexpr DateTime & SDL::DateTime::SetDay |
( |
int |
newDay | ) |
|
|
inlineconstexpr |
- Parameters
-
- Returns
- Reference to self.
◆ SetDay_of_week()
constexpr DateTime & SDL::DateTime::SetDay_of_week |
( |
int |
newDay_of_week | ) |
|
|
inlineconstexpr |
- Parameters
-
newDay_of_week | the new day_of_week value. |
- Returns
- Reference to self.
◆ SetHour()
constexpr DateTime & SDL::DateTime::SetHour |
( |
int |
newHour | ) |
|
|
inlineconstexpr |
- Parameters
-
newHour | the new hour value. |
- Returns
- Reference to self.
◆ SetMinute()
constexpr DateTime & SDL::DateTime::SetMinute |
( |
int |
newMinute | ) |
|
|
inlineconstexpr |
- Parameters
-
newMinute | the new minute value. |
- Returns
- Reference to self.
◆ SetMonth()
constexpr DateTime & SDL::DateTime::SetMonth |
( |
int |
newMonth | ) |
|
|
inlineconstexpr |
- Parameters
-
newMonth | the new month value. |
- Returns
- Reference to self.
◆ SetNanosecond()
constexpr DateTime & SDL::DateTime::SetNanosecond |
( |
int |
newNanosecond | ) |
|
|
inlineconstexpr |
- Parameters
-
newNanosecond | the new nanosecond value. |
- Returns
- Reference to self.
◆ SetSecond()
constexpr DateTime & SDL::DateTime::SetSecond |
( |
int |
newSecond | ) |
|
|
inlineconstexpr |
- Parameters
-
newSecond | the new second value. |
- Returns
- Reference to self.
◆ SetUtc_offset()
constexpr DateTime & SDL::DateTime::SetUtc_offset |
( |
int |
newUtc_offset | ) |
|
|
inlineconstexpr |
- Parameters
-
newUtc_offset | the new utc_offset value. |
- Returns
- Reference to self.
◆ SetYear()
constexpr DateTime & SDL::DateTime::SetYear |
( |
int |
newYear | ) |
|
|
inlineconstexpr |
- Parameters
-
newYear | the new year value. |
- Returns
- Reference to self.
The documentation for this struct was generated from the following file: