![]() |
OpenSiv3D
v0.6.5
C++20 framework for creative coding
|
#include <DateTime.hpp>
Inherits s3d::Date.
Public Member Functions | |
| SIV3D_NODISCARD_CXX20 | DateTime () noexcept=default |
| デフォルトコンストラクタ More... | |
| constexpr SIV3D_NODISCARD_CXX20 | DateTime (int32 _year, int32 _month, int32 _day, int32 _hour=0, int32 _minute=0, int32 _second=0, int32 _milliseconds=0) noexcept |
| 日付と時刻を作成します。 More... | |
| constexpr SIV3D_NODISCARD_CXX20 | DateTime (const Date &date, int32 _hour=0, int32 _minute=0, int32 _second=0, int32 _milliseconds=0) noexcept |
| 日付と時刻を作成します。 More... | |
| constexpr bool | isValid () const noexcept |
| 日付と時刻の妥当性を返します。 More... | |
| String | format (StringView format=U"yyyy-MM-dd HH:mm:ss"_sv) const |
| 日付と時刻を指定したフォーマットの文字列で返します。 yyyy 4 桁の年 (0001-) yy 2 桁の年 (00-99) y 年 (1-) MMMM 英語の月 (January-December) MMM 英語の月の略称 (Jan-Dec) MM 2 桁の月 (01-12) M 1-2 桁の月 (1-12) dd 2 桁の日 (01-31) d 1-2 桁の日 (1-31) EEEE 英語の曜日 (Sunday-Saturday) EEE 英語の曜日の略称 (Sun-Sat) a 午前/午後 (AM/PM) HH 24 時間表記の 2 桁の時 (00-23) H 24 時間表記の時 (0-23) hh 12 時間表記の 2 桁の時 (00-11) h 12 時間表記の時 (0-11) mm 2 桁の分 (00-59) ss 2 桁の秒 (00-59) S 小数点以下 1 桁の秒 (0-9) SS 小数点以下 2 桁の秒 (00-99) SSS 小数点以下 3 桁の秒 (000-999) More... | |
| DateTime | operator+ (const Days &days) const noexcept |
| DateTime | operator+ (const Milliseconds &_milliseconds) const noexcept |
| DateTime | operator- (const Days &days) const noexcept |
| DateTime | operator- (const Milliseconds &_milliseconds) const noexcept |
| DateTime & | operator+= (const Days &days) noexcept |
| DateTime & | operator+= (const Milliseconds &_milliseconds) noexcept |
| DateTime & | operator-= (const Days &days) noexcept |
| DateTime & | operator-= (const Milliseconds &_milliseconds) noexcept |
| size_t | hash () const noexcept |
| 日付と時刻のハッシュ値を返します More... | |
Public Member Functions inherited from s3d::Date | |
| SIV3D_NODISCARD_CXX20 | Date () noexcept=default |
| デフォルトコンストラクタ More... | |
| constexpr SIV3D_NODISCARD_CXX20 | Date (int32 _year, int32 _month=1, int32 _day=1) noexcept |
| 日付を作成します。 More... | |
| constexpr DayOfWeek | dayOfWeek () const noexcept |
| 曜日を返します。 More... | |
| bool | isToday () const noexcept |
| 現在のローカルの年月日と一致するかを返します。 More... | |
| constexpr bool | isLeapYear () const noexcept |
| うるう年であるかを返します。 More... | |
| constexpr int32 | daysInYear () const noexcept |
| 1 年の日数を返します。 More... | |
| constexpr int32 | daysInMonth () const noexcept |
| 月の日数を返します。 More... | |
| constexpr bool | isValid () const noexcept |
| 日付の妥当性を返します。 More... | |
| String | format (StringView format=U"yyyy-MM-dd"_sv) const |
| 日付を指定したフォーマットの文字列で返します。 yyyy 4 桁の年 (0001-) yy 2 桁の年 (00-99) y 年 (1-) MMMM 英語の月 (January-December) MMM 英語の月の略称 (Jan-Dec) MM 2 桁の月 (01-12) M 1-2 桁の月 (1-12) dd 2 桁の日 (01-31) d 1-2 桁の日 (1-31) EEEE 英語の曜日 (Sunday-Saturday) EEE 英語の曜日の略称 (Sun-Sat) E 日本語の曜日 (日-土) More... | |
| Date | operator+ (const Days &days) const noexcept |
| 指定した日数だけ進めた日付を返します。 More... | |
| Date | operator- (const Days &days) const noexcept |
| 指定した日数だけ戻した日付を返します。 More... | |
| Date & | operator+= (const Days &days) noexcept |
| 日付を進めます More... | |
| Date & | operator-= (const Days &days) noexcept |
| 日付を戻します More... | |
| size_t | hash () const noexcept |
| 日付のハッシュ値を返します More... | |
Static Public Member Functions | |
| static DateTime | Yesterday () noexcept |
| 昨日の日付と時刻(ローカルタイム)を返します。 More... | |
| static DateTime | Today () noexcept |
| 今日の日付と時刻(ローカルタイム)を返します。 More... | |
| static DateTime | Tomorrow () noexcept |
| 明日の日付と時刻(ローカルタイム)を返します。 More... | |
| static DateTime | Now () noexcept |
| 現在の日付と時刻(ローカルタイム)を返します。 More... | |
| static DateTime | NowUTC () noexcept |
| 現在の日付と時刻(協定世界時刻(UTC))を返します。 More... | |
| static constexpr Duration | Subtract (const DateTime &a, const DateTime &b) noexcept |
Static Public Member Functions inherited from s3d::Date | |
| static Date | Yesterday () noexcept |
| 昨日の日付(ローカルタイム)を返します。 More... | |
| static Date | Today () noexcept |
| 現在の日付(ローカルタイム)を返します。 More... | |
| static Date | Tomorrow () noexcept |
| 明日の日付(ローカルタイム)を返します。 More... | |
| static constexpr bool | IsLeapYear (int32 year) noexcept |
| static constexpr int32 | DaysInYear (int32 year) noexcept |
| static constexpr int32 | DaysInMonth (int32 year, int32 month) noexcept |
| static constexpr Days | Subtract (const Date &a, const Date &b) noexcept |
Public Attributes | |
| int32 | hour |
| 時 [0-23] More... | |
| int32 | minute |
| 分 [0-59] More... | |
| int32 | second |
| 秒 [0-59] More... | |
| int32 | milliseconds |
| ミリ秒 [0-999] More... | |
Public Attributes inherited from s3d::Date | |
| int32 | year |
| 西暦 More... | |
| int32 | month |
| 月 [1-12] More... | |
| int32 | day |
| 日 [1-31] More... | |
Friends | |
| constexpr friend Duration | operator- (const DateTime &to, const DateTime &from) noexcept |
| bool | operator== (const DateTime &lhs, const DateTime &rhs) noexcept |
| bool | operator!= (const DateTime &lhs, const DateTime &rhs) noexcept |
| bool | operator< (const DateTime &lhs, const DateTime &rhs) noexcept |
| bool | operator> (const DateTime &lhs, const DateTime &rhs) noexcept |
| bool | operator<= (const DateTime &lhs, const DateTime &rhs) noexcept |
| bool | operator>= (const DateTime &lhs, const DateTime &rhs) noexcept |
| template<class CharType > | |
| std::basic_ostream< CharType > & | operator<< (std::basic_ostream< CharType > &output, const DateTime &value) |
| void | Formatter (FormatData &formatData, const DateTime &value) |
日付と時刻 | Date and time
|
defaultnoexcept |
デフォルトコンストラクタ
|
constexprnoexcept |
日付と時刻を作成します。
| _year | 年 |
| _month | 月 [1-12] |
| _day | 日 [1-31] |
| _hour | 時 [0-23]、デフォルトでは 0 |
| _minute | 分 [0-59]、デフォルトでは 0 |
| _second | 秒 [0-59]、デフォルトでは 0 |
| _milliseconds | ミリ秒 [0-999]、デフォルトでは 0 |
|
constexprnoexcept |
日付と時刻を作成します。
| date | 日付 |
| _hour | 時 [0-23]、デフォルトでは 0 |
| _minute | 分 [0-59]、デフォルトでは 0 |
| _second | 秒 [0-59]、デフォルトでは 0 |
| _milliseconds | ミリ秒 [0-999]、デフォルトでは 0 |
| String s3d::DateTime::format | ( | StringView | format = U"yyyy-MM-dd HH:mm:ss"_sv | ) | const |
日付と時刻を指定したフォーマットの文字列で返します。 yyyy 4 桁の年 (0001-) yy 2 桁の年 (00-99) y 年 (1-) MMMM 英語の月 (January-December) MMM 英語の月の略称 (Jan-Dec) MM 2 桁の月 (01-12) M 1-2 桁の月 (1-12) dd 2 桁の日 (01-31) d 1-2 桁の日 (1-31) EEEE 英語の曜日 (Sunday-Saturday) EEE 英語の曜日の略称 (Sun-Sat) a 午前/午後 (AM/PM) HH 24 時間表記の 2 桁の時 (00-23) H 24 時間表記の時 (0-23) hh 12 時間表記の 2 桁の時 (00-11) h 12 時間表記の時 (0-11) mm 2 桁の分 (00-59) ss 2 桁の秒 (00-59) S 小数点以下 1 桁の秒 (0-9) SS 小数点以下 2 桁の秒 (00-99) SSS 小数点以下 3 桁の秒 (000-999)
| format | フォーマット指定 |
|
noexcept |
日付と時刻のハッシュ値を返します
|
constexprnoexcept |
日付と時刻の妥当性を返します。
|
staticnoexcept |
現在の日付と時刻(ローカルタイム)を返します。
|
staticnoexcept |
現在の日付と時刻(協定世界時刻(UTC))を返します。
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
staticconstexprnoexcept |
| a | |
| b |
|
staticnoexcept |
今日の日付と時刻(ローカルタイム)を返します。
|
staticnoexcept |
明日の日付と時刻(ローカルタイム)を返します。
|
staticnoexcept |
昨日の日付と時刻(ローカルタイム)を返します。
|
friend |
|
friend |
| int32 s3d::DateTime::hour |
時 [0-23]
| int32 s3d::DateTime::milliseconds |
ミリ秒 [0-999]
| int32 s3d::DateTime::minute |
分 [0-59]
| int32 s3d::DateTime::second |
秒 [0-59]