|
TNB Library
|
システムタイム管理クラス [詳解]
#include <TnbTime.h>
CSystemTime の継承関係図公開メンバ関数 | |
| CSystemTime & | AddDay (int iDay) |
| [加算] 日加算 [詳解] | |
| CSystemTime & | AddHour (int iHour) |
| [加算] 時加算 [詳解] | |
| CSystemTime & | AddMillSec (LONGLONG llMillSec) |
| [加算] ミリ秒加算 [詳解] | |
| CSystemTime & | AddMinute (int iMinute) |
| [加算] 分加算 [詳解] | |
| CSystemTime & | AddMonth (int iMonth) |
| [加算] 月加算 [詳解] | |
| CSystemTime & | AddSecond (LONGLONG iSecond) |
| [加算] 秒加算 [詳解] | |
| CSystemTime & | AddYear (int iYear) |
| [加算] 年加算 [詳解] | |
| virtual INT_PTR | Compare (const CSystemTime &t) const |
| [確認] 比較 [詳解] | |
| CSystemTime (const FILETIME &ft) | |
| 代入コンストラクタ [詳解] | |
| CSystemTime (const SYSTEMTIME &st) | |
| 代入コンストラクタ [詳解] | |
| CSystemTime (const time_t &tm) | |
| 代入コンストラクタ [詳解] | |
| CSystemTime (void) | |
| コンストラクタ [詳解] | |
| void | Empty (void) |
| [設定] 空化 [詳解] | |
| CStr | Format (LPCTSTR lpszFormat=NULL) const |
| [作成] 文字列作成 [詳解] | |
| WORD | GetDay (void) const |
| [取得] 日取得 [詳解] | |
| WORD | GetHour (void) const |
| [取得] 時取得 [詳解] | |
| WORD | GetMillSec (void) const |
| [取得] ミリ秒取得 [詳解] | |
| WORD | GetMinute (void) const |
| [取得] 分取得 [詳解] | |
| WORD | GetMonth (void) const |
| [取得] 月取得 [詳解] | |
| WORD | GetSecond (void) const |
| [取得] 秒取得 [詳解] | |
| WORD | GetYear (void) const |
| [取得] 年取得 [詳解] | |
| bool | IsEmpty (void) const |
| [確認] 状態確認 [詳解] | |
| virtual bool | IsEqual (const TNB::CSystemTime &t) const |
| [確認] 比較 [詳解] | |
| bool | IsValid (void) const |
| [確認] 有効確認. [詳解] | |
| CSystemTime | LocalToTzSpecificLocal (LPTIME_ZONE_INFORMATION lpTzInfo) const |
| [取得] 指定ローカルタイム取得 [詳解] | |
| CSystemTime | LocalToUtc (void) const |
| [取得] UTC取得 [詳解] | |
| bool | operator!= (const TNB::CSystemTime &t) const |
| [確認] 比較 [詳解] | |
| LONGLONG | operator- (const CSystemTime &t) const |
| [取得] 時間差 [詳解] | |
| bool | operator< (const TNB::CSystemTime &t) const |
| [確認] 比較 [詳解] | |
| bool | operator<= (const TNB::CSystemTime &t) const |
| [確認] 比較 [詳解] | |
| CSystemTime & | operator= (const FILETIME &ft) |
| [代入] 代入 [詳解] | |
| CSystemTime & | operator= (const SYSTEMTIME &st) |
| [代入] 代入 [詳解] | |
| CSystemTime & | operator= (const time_t &tm) |
| [代入] 代入 [詳解] | |
| bool | operator== (const TNB::CSystemTime &t) const |
| [確認] 比較 [詳解] | |
| bool | operator> (const TNB::CSystemTime &t) const |
| [確認] 比較 [詳解] | |
| bool | operator>= (const TNB::CSystemTime &t) const |
| [確認] 比較 [詳解] | |
| void | Set (int iYear, int iMonth, int iDay) |
| [代入] 代入. [詳解] | |
| void | StringTo (LPCTSTR lpsz) |
| [代入] 文字列による代入. [詳解] | |
| int | ToJapaneseEra (int &_iYear) const |
| [作成] 和年号作成. [詳解] | |
| CStr | ToTimeString (void) const |
| [作成] 文字列作成 [詳解] | |
| CSystemTime | UtcToLocal (void) const |
| [取得] ローカルタイム取得 [詳解] | |
静的公開メンバ関数 | |
| static CSystemTime | GetCurrent (void) |
| [取得] 現在の時間(LOCAL) [詳解] | |
| static CSystemTime | GetCurrentUtc (void) |
| [取得] 現在の時間(UTC) [詳解] | |
| static DWORD | GetDayOfTheWeek (const SYSTEMTIME &t) |
| [計算] 曜日計算. [詳解] | |
| static DWORD | GetEndOfMonth (DWORD dwYear, DWORD dwMonth) |
| [計算] 末日計算 [詳解] | |
| static bool | IsLeap (DWORD dwYear) |
| [確認] 閏年判定 [詳解] | |
公開変数類 | |
| WORD | wDay |
| 日 [詳解] | |
| WORD | wDayOfWeek |
| 曜日 [詳解] | |
| WORD | wHour |
| 時 [詳解] | |
| WORD | wMilliseconds |
| ミリ秒 [詳解] | |
| WORD | wMinute |
| 分 [詳解] | |
| WORD | wMonth |
| 月 [詳解] | |
| WORD | wSecond |
| 秒 [詳解] | |
| WORD | wYear |
| 年 [詳解] | |
システムタイム管理クラス
基本的に保持している情報は現在のタイムゾーンの Local Time です。 UTC を代入すると、 Local Time に変換し格納します。 SYSTEMTIME を public継承していますので、 SYSTEMTIME を引数にもつ API に直接使えます。
| CSystemTime | ( | void | ) |
| CSystemTime | ( | const SYSTEMTIME & | st | ) |
| CSystemTime | ( | const FILETIME & | ft | ) |
| CSystemTime | ( | const time_t & | tm | ) |
| CSystemTime & AddDay | ( | int | iDay | ) |
| CSystemTime & AddHour | ( | int | iHour | ) |
| CSystemTime & AddMillSec | ( | LONGLONG | llMillSec | ) |
| CSystemTime & AddMinute | ( | int | iMinute | ) |
| CSystemTime & AddMonth | ( | int | iMonth | ) |
| CSystemTime & AddSecond | ( | LONGLONG | iSecond | ) |
| CSystemTime & AddYear | ( | int | iYear | ) |
|
virtual |
[確認] 比較
| t | 比較対象 |
| 0 | 自分は t と同じ |
| 1以上 | 自分は t より大きい |
| 0未満 | 自分は t より小さい |
IComparableT< TNB::CSystemTime >を実装しています。
| CStr Format | ( | LPCTSTR | lpszFormat = NULL | ) | const |
[作成] 文字列作成
| lpszFormat | フォーマット。省略すると、"%Y-%m-%d %H:%M:%S"が適用されます |
|
static |
|
static |
|
static |
|
static |
|
virtualinherited |
|
static |
| bool IsValid | ( | void | ) | const |
| CSystemTime LocalToTzSpecificLocal | ( | LPTIME_ZONE_INFORMATION | lpTzInfo | ) | const |
| CSystemTime LocalToUtc | ( | void | ) | const |
|
inherited |
| LONGLONG operator- | ( | const CSystemTime & | t | ) | const |
|
inherited |
|
inherited |
| CSystemTime & operator= | ( | const FILETIME & | ft | ) |
| CSystemTime & operator= | ( | const SYSTEMTIME & | st | ) |
| CSystemTime & operator= | ( | const time_t & | tm | ) |
|
inherited |
|
inherited |
|
inherited |
| void Set | ( | int | iYear, |
| int | iMonth, | ||
| int | iDay | ||
| ) |
| void StringTo | ( | LPCTSTR | lpsz | ) |
| int ToJapaneseEra | ( | int & | _iYear | ) | const |
[作成] 和年号作成.
現在保持している年を和暦に変換します。 明治は 1868/1/25、大正は 1912/7/30、昭和は 1926/12/25、平成は 1989/1/7、令和は 2019/5/1 を始まりとしています。
| [out] | _iYear | 和暦の年 |
| -1 | エラー |
| 0 | 明治 |
| 1 | 大正 |
| 2 | 昭和 |
| 3 | 平成 |
| 4 | 令和 |
明治の始まり
大正の始まり
昭和の始まり
平成の始まり
令和の始まり
| CStr ToTimeString | ( | void | ) | const |
| CSystemTime UtcToLocal | ( | void | ) | const |