本文整理汇总了C++中CDateTimeSpan::GetDays方法的典型用法代码示例。如果您正苦于以下问题:C++ CDateTimeSpan::GetDays方法的具体用法?C++ CDateTimeSpan::GetDays怎么用?C++ CDateTimeSpan::GetDays使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDateTimeSpan
的用法示例。
在下文中一共展示了CDateTimeSpan::GetDays方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetStartTime
int CPVRGUIInfo::GetStartTime(void) const
{
CSingleLock lock(m_critSection);
if (m_playingEpgTag)
{
/* Calculate here the position we have of the running live TV event.
* "position in ms" = ("current local time" - "event start local time") * 1000
*/
CDateTime current = CDateTime::GetCurrentDateTime();
CDateTime start = m_playingEpgTag->StartAsLocalTime();
CDateTimeSpan time = current > start ? current - start : CDateTimeSpan(0, 0, 0, 0);
return (time.GetDays() * 60 * 60 * 24
+ time.GetHours() * 60 * 60
+ time.GetMinutes() * 60
+ time.GetSeconds()) * 1000;
}
else
{
return 0;
}
}
示例2: Compare
int CPVRTimerInfoTag::Compare(const CPVRTimerInfoTag &timer) const
{
CSingleLock lock(m_critSection);
int iTimerDelta = 0;
if (StartAsUTC() != timer.StartAsUTC())
{
CDateTimeSpan timerDelta = StartAsUTC() - timer.StartAsUTC();
iTimerDelta = (timerDelta.GetSeconds() + timerDelta.GetMinutes() * 60 + timerDelta.GetHours() * 3600 + timerDelta.GetDays() * 86400);
}
/* if the start times are equal, compare the priority of the timers */
return iTimerDelta == 0 ?
timer.m_iPriority - m_iPriority :
iTimerDelta;
}
示例3: GetTotalSeconds
static int GetTotalSeconds(const CDateTimeSpan& ts)
{
int hours = ts.GetHours() + ts.GetDays() * 24;
int minutes = ts.GetMinutes() + hours * 60;
return ts.GetSeconds() + minutes * 60;
}