本文整理汇总了C++中TTm::GetHour方法的典型用法代码示例。如果您正苦于以下问题:C++ TTm::GetHour方法的具体用法?C++ TTm::GetHour怎么用?C++ TTm::GetHour使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTm
的用法示例。
在下文中一共展示了TTm::GetHour方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetMSecsFromTm
uint64 TSysTm::GetMSecsFromTm(const TTm& Tm){
SYSTEMTIME SysTm; FILETIME FileTm;
SysTm.wYear=WORD(Tm.GetYear());
SysTm.wMonth=WORD(Tm.GetMonth());
SysTm.wDayOfWeek=WORD(Tm.GetDayOfWeek());
SysTm.wDay=WORD(Tm.GetDay());
SysTm.wHour=WORD(Tm.GetHour());
SysTm.wMinute=WORD(Tm.GetMin());
SysTm.wSecond=WORD(Tm.GetSec());
SysTm.wMilliseconds=WORD(Tm.GetMSec());
ESAssert(SystemTimeToFileTime(&SysTm, &FileTm));
TUInt64 UInt64(uint(FileTm.dwHighDateTime), uint(FileTm.dwLowDateTime));
return UInt64.Val/uint64(10000);
}
示例2: GetLocTmFromUniTm
TTm TSysTm::GetLocTmFromUniTm(const TTm& Tm){
// get time-zone information
TIME_ZONE_INFORMATION TzInf;
GetTimeZoneInformation(&TzInf);
// get system time
SYSTEMTIME UniSysTm;
UniSysTm.wYear=WORD(Tm.GetYear());
UniSysTm.wMonth=WORD(Tm.GetMonth());
UniSysTm.wDayOfWeek=WORD(Tm.GetDayOfWeek());
UniSysTm.wDay=WORD(Tm.GetDay());
UniSysTm.wHour=WORD(Tm.GetHour());
UniSysTm.wMinute=WORD(Tm.GetMin());
UniSysTm.wSecond=WORD(Tm.GetSec());
UniSysTm.wMilliseconds=WORD(Tm.GetMSec());
// convert system-time
SYSTEMTIME LocSysTm;
SystemTimeToTzSpecificLocalTime(&TzInf, &UniSysTm, &LocSysTm);
// return local-time
return TTm(LocSysTm.wYear, LocSysTm.wMonth, LocSysTm.wDay, LocSysTm.wDayOfWeek,
LocSysTm.wHour, LocSysTm.wMinute, LocSysTm.wSecond, LocSysTm.wMilliseconds);
}
示例3: GetUniTmFromLocTm
TTm TSysTm::GetUniTmFromLocTm(const TTm& Tm){
// get time-zone information
TIME_ZONE_INFORMATION TzInf;
GetTimeZoneInformation(&TzInf);
// get system time
SYSTEMTIME LocSysTm;
LocSysTm.wYear=WORD(Tm.GetYear());
LocSysTm.wMonth=WORD(Tm.GetMonth());
LocSysTm.wDayOfWeek=WORD(Tm.GetDayOfWeek());
LocSysTm.wDay=WORD(Tm.GetDay());
LocSysTm.wHour=WORD(Tm.GetHour());
LocSysTm.wMinute=WORD(Tm.GetMin());
LocSysTm.wSecond=WORD(Tm.GetSec());
LocSysTm.wMilliseconds=WORD(Tm.GetMSec());
// convert system-time
SYSTEMTIME UniSysTm=LocSysTm;
Fail; // BCB5.0 doesn't find TzSpecificLocalTimeToSystemTime
//TzSpecificLocalTimeToSystemTime(&TzInf, &LocSysTm, &UniSysTm);
// return system-time
return TTm(UniSysTm.wYear, UniSysTm.wMonth, UniSysTm.wDay, UniSysTm.wDayOfWeek,
UniSysTm.wHour, UniSysTm.wMinute, UniSysTm.wSecond, UniSysTm.wMilliseconds);
}
示例4: GetFolderNameForCurrentTime
TStr TBackupProfile::GetFolderNameForCurrentTime() const
{
TTm Now = TTm::GetCurLocTm();
return Now.GetYMDDashStr() + " " + TStr::Fmt("%02d-%02d-%02d", Now.GetHour(), Now.GetMin(), Now.GetSec());
}
示例5: AbsSecs
TSecTm::TSecTm(const TTm& Tm): AbsSecs(
TSecTm(Tm.GetYear(), Tm.GetMonth(), Tm.GetDay(), Tm.GetHour(),
Tm.GetMin(), int(TMath::Round(Tm.GetSec()*1000+Tm.GetMSec()))).GetAbsSecs()){}
示例6: GetDateTimeIntFromTm
uint TTm::GetDateTimeIntFromTm(const TTm& Tm) {
return GetDateTimeInt(Tm.GetYear(), Tm.GetMonth(),
Tm.GetDay(), Tm.GetHour(), Tm.GetMin());
}
示例7: AbsSecs
TSecTm::TSecTm(const TTm& Tm): AbsSecs(
TSecTm(Tm.GetYear(), Tm.GetMonth(), Tm.GetDay(), Tm.GetHour(),
Tm.GetMin(), Tm.GetSec()).GetAbsSecs()) { }
示例8: GetDateTimeIntFromTm
uint TTm::GetDateTimeIntFromTm(const TTm& Tm) {
return Tm.IsDef() ?
GetDateTimeInt(Tm.GetYear(), Tm.GetMonth(),
Tm.GetDay(), Tm.GetHour(), Tm.GetMin(), Tm.GetSec()) : 0;
}