本文整理汇总了C++中TimeSpan::GetMinutes方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeSpan::GetMinutes方法的具体用法?C++ TimeSpan::GetMinutes怎么用?C++ TimeSpan::GetMinutes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeSpan
的用法示例。
在下文中一共展示了TimeSpan::GetMinutes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: uptime
void
Form2::SetTimer(void)
{
long long tick ;
// Get current tick value
Tizen::Base::TimeSpan uptime(0);
result r = Tizen::System::SystemTime::GetUptime(uptime);
if (IsFailed(r))
{
AppLog("System uptime not available\n");
return ;
}
tick = uptime.GetTicks();
tick -= __startTick;
TimeSpan span = static_cast<long>(tick);
String __watchText;
// Set StopWatch String
__watchText.Clear();
if(span.GetMinutes() < 10)
{
__watchText.Append("0");
}
__watchText.Append(span.GetMinutes());
__watchText.Append(":");
if(span.GetSeconds() < 10)
{
__watchText.Append("0");
}
__watchText.Append(span.GetSeconds());
__watchText.Append(":");
if(span.GetMilliseconds() / 10 < 10)
{
__watchText.Append("0");
}
__watchText.Append(span.GetMilliseconds() / 10);
__pLabel2->SetText(__watchText);
__pLabel2->Invalidate(false);
__pLabel2->Show();
return;
}
示例2: GetRelativeTimeFromTimeStamp
String Utils::GetRelativeTimeFromTimeStamp(DateTime receivedTime)
{
DateTime currentTime;
//DateTime receivedTime;
String relativeTime;
int mins = 0;
int hours = 0;
int days = 0;
SystemTime::GetCurrentTime(WALL_TIME, currentTime);
//receivedTime = Utils::ConvertUtcTimeToStardardTime(timeStamp);
TimeSpan timeDiff = (currentTime.GetTime() - receivedTime.GetTime());
days = timeDiff.GetDays();
hours = timeDiff.GetHours();
mins = timeDiff.GetMinutes();
if(days >= 1)
{
relativeTime.Format(20, L"%d days ago", days);
}
else if (hours > 0)
relativeTime.Format(20, L"%dhr%dmin ago",hours, mins);
else
relativeTime.Format(20, L"%dmin ago", mins);
return relativeTime;
}
示例3: formatDelay
String Utils::formatDelay(TimeSpan delay){
int hour = delay.GetHours();
int min = delay.GetMinutes();
if(min==0 && hour ==0)
return L"";
String time = L"+" + Integer::ToString(hour)+ L"H";
if(min < 10) time += L"0";
time += Integer::ToString(min);
return time;
}
示例4: formatTime
String Utils::formatTime(TimeSpan duration){
int hour = duration.GetHours();
int min = duration.GetMinutes();
String time;
if(hour<10) time += L"0";
time += Integer::ToString(hour)+ L":";
if(min < 10) time += L"0";
time += Integer::ToString(min);
return time;
}