A structure holding a calendar date and time broken down into its components.
More...
|
| constexpr | DateTime (const DateTimeRaw &dateTime={}) noexcept |
| | Wraps DateTime.
|
| constexpr | DateTime (int year, int month, int day, int hour, int minute, int second, int nanosecond, int day_of_week, int utc_offset) noexcept |
| | Constructs from its fields.
|
| | DateTime (Time ticks, bool localTime=true) |
| | Converts an Time in nanoseconds since the epoch to a calendar time in the DateTime format.
|
| constexpr | operator bool () const noexcept |
| | Check if valid.
|
| constexpr int | GetYear () const noexcept |
| | Get the year.
|
| constexpr DateTime & | SetYear (int newYear) noexcept |
| | Set the year.
|
| constexpr int | GetMonth () const noexcept |
| | Get the month.
|
| constexpr DateTime & | SetMonth (int newMonth) noexcept |
| | Set the month.
|
| constexpr int | GetDay () const noexcept |
| | Get the day.
|
| constexpr DateTime & | SetDay (int newDay) noexcept |
| | Set the day.
|
| constexpr int | GetHour () const noexcept |
| | Get the hour.
|
| constexpr DateTime & | SetHour (int newHour) noexcept |
| | Set the hour.
|
| constexpr int | GetMinute () const noexcept |
| | Get the minute.
|
| constexpr DateTime & | SetMinute (int newMinute) noexcept |
| | Set the minute.
|
| constexpr int | GetSecond () const noexcept |
| | Get the second.
|
| constexpr DateTime & | SetSecond (int newSecond) noexcept |
| | Set the second.
|
| constexpr int | GetNanosecond () const noexcept |
| | Get the nanosecond.
|
| constexpr DateTime & | SetNanosecond (int newNanosecond) noexcept |
| | Set the nanosecond.
|
| constexpr int | GetDay_of_week () const noexcept |
| | Get the day_of_week.
|
| constexpr DateTime & | SetDay_of_week (int newDay_of_week) noexcept |
| | Set the day_of_week.
|
| constexpr int | GetUtc_offset () const noexcept |
| | Get the utc_offset.
|
| constexpr DateTime & | SetUtc_offset (int newUtc_offset) noexcept |
| | Set the utc_offset.
|
| | operator Time () const |
| | Converts a calendar time to an Time in nanoseconds since the epoch.
|
A structure holding a calendar date and time broken down into its components.
- Since
- This struct is available since SDL 3.2.0.
◆ DateTime() [1/2]
| SDL::DateTime::DateTime |
( |
const DateTimeRaw & | dateTime = {} | ) |
|
|
inlineconstexprnoexcept |
Wraps DateTime.
- Parameters
-
| dateTime | the value to be wrapped |
◆ DateTime() [2/2]
| SDL::DateTime::DateTime |
( |
int | year, |
|
|
int | month, |
|
|
int | day, |
|
|
int | hour, |
|
|
int | minute, |
|
|
int | second, |
|
|
int | nanosecond, |
|
|
int | day_of_week, |
|
|
int | utc_offset ) |
|
inlineconstexprnoexcept |
Constructs from its fields.
- 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. |
◆ GetDay()
| int SDL::DateTime::GetDay |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the day.
- Returns
- current day value.
◆ GetDay_of_week()
| int SDL::DateTime::GetDay_of_week |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the day_of_week.
- Returns
- current day_of_week value.
◆ GetHour()
| int SDL::DateTime::GetHour |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the hour.
- Returns
- current hour value.
◆ GetMinute()
| int SDL::DateTime::GetMinute |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the minute.
- Returns
- current minute value.
◆ GetMonth()
| int SDL::DateTime::GetMonth |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the month.
- Returns
- current month value.
◆ GetNanosecond()
| int SDL::DateTime::GetNanosecond |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the nanosecond.
- Returns
- current nanosecond value.
◆ GetSecond()
| int SDL::DateTime::GetSecond |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the second.
- Returns
- current second value.
◆ GetUtc_offset()
| int SDL::DateTime::GetUtc_offset |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the utc_offset.
- Returns
- current utc_offset value.
◆ GetYear()
| int SDL::DateTime::GetYear |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the year.
- Returns
- current year value.
◆ operator bool()
| SDL::DateTime::operator bool |
( |
| ) |
const |
|
inlineexplicitconstexprnoexcept |
Check if valid.
- Returns
- True if valid state, false otherwise.
◆ SetDay()
| DateTime & SDL::DateTime::SetDay |
( |
int | newDay | ) |
|
|
inlineconstexprnoexcept |
Set the day.
- Parameters
-
- Returns
- Reference to self.
◆ SetDay_of_week()
| DateTime & SDL::DateTime::SetDay_of_week |
( |
int | newDay_of_week | ) |
|
|
inlineconstexprnoexcept |
Set the day_of_week.
- Parameters
-
| newDay_of_week | the new day_of_week value. |
- Returns
- Reference to self.
◆ SetHour()
| DateTime & SDL::DateTime::SetHour |
( |
int | newHour | ) |
|
|
inlineconstexprnoexcept |
Set the hour.
- Parameters
-
| newHour | the new hour value. |
- Returns
- Reference to self.
◆ SetMinute()
| DateTime & SDL::DateTime::SetMinute |
( |
int | newMinute | ) |
|
|
inlineconstexprnoexcept |
Set the minute.
- Parameters
-
| newMinute | the new minute value. |
- Returns
- Reference to self.
◆ SetMonth()
| DateTime & SDL::DateTime::SetMonth |
( |
int | newMonth | ) |
|
|
inlineconstexprnoexcept |
Set the month.
- Parameters
-
| newMonth | the new month value. |
- Returns
- Reference to self.
◆ SetNanosecond()
| DateTime & SDL::DateTime::SetNanosecond |
( |
int | newNanosecond | ) |
|
|
inlineconstexprnoexcept |
Set the nanosecond.
- Parameters
-
| newNanosecond | the new nanosecond value. |
- Returns
- Reference to self.
◆ SetSecond()
| DateTime & SDL::DateTime::SetSecond |
( |
int | newSecond | ) |
|
|
inlineconstexprnoexcept |
Set the second.
- Parameters
-
| newSecond | the new second value. |
- Returns
- Reference to self.
◆ SetUtc_offset()
| DateTime & SDL::DateTime::SetUtc_offset |
( |
int | newUtc_offset | ) |
|
|
inlineconstexprnoexcept |
Set the utc_offset.
- Parameters
-
| newUtc_offset | the new utc_offset value. |
- Returns
- Reference to self.
◆ SetYear()
| DateTime & SDL::DateTime::SetYear |
( |
int | newYear | ) |
|
|
inlineconstexprnoexcept |
Set the year.
- Parameters
-
| newYear | the new year value. |
- Returns
- Reference to self.
The documentation for this struct was generated from the following file: