本文整理汇总了C++中TTime::HoursFrom方法的典型用法代码示例。如果您正苦于以下问题:C++ TTime::HoursFrom方法的具体用法?C++ TTime::HoursFrom怎么用?C++ TTime::HoursFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTime
的用法示例。
在下文中一共展示了TTime::HoursFrom方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsTimeBeforeL
/*
-------------------------------------------------------------------------
-------------------------------------------------------------------------
*/
TBool CExPolicy_Server::IsTimeBeforeL(TTime& aTime,TTime& aCompare)
{
TBool IsBefore(EFalse);
TTimeIntervalMinutes MinInterval(0);
TTimeIntervalHours HourInterval(0);
TTimeIntervalSeconds SecInterval(0);
TTime TimeNow;
TimeNow.HomeTime();
TTimeIntervalDays DaysInterval = aTime.DaysFrom(aCompare);
if(DaysInterval.Int() <= 0)
{
aTime.HoursFrom(aCompare,HourInterval);
if(HourInterval.Int() <= 0)
{
aTime.MinutesFrom(aCompare,MinInterval);
if(MinInterval.Int() <= 0)
{
aTime.SecondsFrom(aCompare, SecInterval);
if(SecInterval.Int() <= 0)
{
IsBefore = ETrue;
}
}
}
}
return IsBefore;
}
示例2: AppendTimeDifference
void AppendTimeDifference(TDes8& aInto, TTime from, TTime now)
{
CALLSTACKITEM_N(_CL("CLocaLogicImpl"), _CL("~CLocaLogicImpl"));
if (from > now) {
TTime s=from;
from=now;
now=s;
}
for(;;) {
TTimeIntervalMinutes mins;
if (now.MinutesFrom(from, mins)!=KErrNone) {
mins=61;
}
TTimeIntervalHours hours;
if (now.HoursFrom(from, hours)!=KErrNone) {
hours=25;
}
TTimeIntervalDays days;
days=now.DaysFrom(from);
if (mins < TTimeIntervalMinutes(60)) {
aInto.AppendNum(mins.Int());
aInto.Append(_L8(" minutes "));
break;
} else if ( hours < TTimeIntervalDays(24)) {
aInto.AppendNum(hours.Int());
aInto.Append(_L8(" hours "));
from+=TTimeIntervalHours(hours);
} else {
aInto.AppendNum(days.Int());
aInto.Append(_L8(" days "));
from+=TTimeIntervalDays(days);
}
}
}
示例3: IsNowOkL
//.........这里部分代码省略.........
if(MyDStore->IsPresentL(FileUid))
{
MyDStore->Remove(FileUid);
MyDStore->CommitL();
}
RDictionaryWriteStream out5;
out5.AssignLC(*MyDStore,FileUid);
out5.WriteInt32L((TInt)homme.DateTime().Month());
out5.CommitL();
CleanupStack::PopAndDestroy(1);// out5
FileUid.iUid = 0x9786;
if(MyDStore->IsPresentL(FileUid))
{
MyDStore->Remove(FileUid);
MyDStore->CommitL();
}
RDictionaryWriteStream out6;
out6.AssignLC(*MyDStore,FileUid);
out6.WriteInt32L(homme.DateTime().Day());
out6.CommitL();
CleanupStack::PopAndDestroy(1);// out6
FileUid.iUid = 0x9721;
if(MyDStore->IsPresentL(FileUid))
{
MyDStore->Remove(FileUid);
MyDStore->CommitL();
}
RDictionaryWriteStream out61;
out61.AssignLC(*MyDStore,FileUid);
out61.WriteInt32L(homme.DateTime().Hour());
out61.CommitL();
CleanupStack::PopAndDestroy(1);// out61
FileUid.iUid = 0x9722;
if(MyDStore->IsPresentL(FileUid))
{
MyDStore->Remove(FileUid);
MyDStore->CommitL();
}
RDictionaryWriteStream out62;
out62.AssignLC(*MyDStore,FileUid);
out62.WriteInt32L(homme.DateTime().Minute());
out62.CommitL();
CleanupStack::PopAndDestroy(1);// out62
MyDStore->CommitL();
TTime nowwTimm;
nowwTimm.HomeTime();
TTimeIntervalHours leftTimm;
homme.HoursFrom(nowwTimm,leftTimm);
aDaysLeft = leftTimm.Int();
ret = ETrue;
}else{
TTime startTime(TDateTime(sYear,(TMonth)sMonth,sDay,sHour,sMinute,0,0));
TTime middleTime(TDateTime(mYear,(TMonth)mMonth,mDay,mHour,mMinute,0,0));
TTime edningTime(TDateTime(eYear,(TMonth)eMonth,eDay,eHour,eMinute,0,0));
TTimeIntervalMinutes sInterval(0);
TTimeIntervalMinutes mInterval(0);
TTimeIntervalMinutes eInterval(0);
homme.MinutesFrom(startTime,sInterval);
homme.MinutesFrom(middleTime,mInterval);
edningTime.MinutesFrom(homme,eInterval);
if(sInterval.Int() >= 0
&& mInterval.Int() >= 0
&& eInterval.Int() >= 0){
TTimeIntervalHours leftTimm;
edningTime.HoursFrom(homme,leftTimm);
aDaysLeft = leftTimm.Int();
ret = ETrue;
}
}
}else{
/* RDictionaryWriteStream out3;
out3.AssignLC(*MyDStore,FileUid);
out3.WriteInt32L(12985674);
out3.CommitL();
CleanupStack::PopAndDestroy(1);// out3
MyDStore->CommitL();*/
}
CleanupStack::PopAndDestroy(1);// Store
}
fsSession.Close();
return ret;
}