TimeDelta object.
More...
#include <time_delta.h>
TimeDelta object.
A timedelta object represents a duration, the difference between two dates or times.
◆ TimeDelta() [1/2]
EZ::TimeDelta::TimeDelta |
( |
const long long & |
totalSeconds | ) |
|
|
inline |
時刻差を累積秒数で設定する
Set the time difference in seconds.
- Parameters
-
[in] | totalSeconds | Time difference expressed with seconds. |
ex: 366days and 5mins => EZ::TimeDelta(31622700);
◆ TimeDelta() [2/2]
EZ::TimeDelta::TimeDelta |
( |
const long long & |
days, |
|
|
const long long & |
hours, |
|
|
const long long & |
minutes, |
|
|
const long long & |
seconds |
|
) |
| |
|
inline |
時刻差を {日数, 時間数, 分数, 秒数} の順に指定する
Set the time difference in the order of {days, hours, minutes, seconds}.
- Parameters
-
[in] | days | |
[in] | hours | |
[in] | minutes | |
[in] | seconds | |
ex: 366days and 5mins => EZ::TimeDelta(366, 0, 5, 0);
See also member function set().
◆ operator*()
TimeDelta EZ::TimeDelta::operator* |
( |
const double & |
right | ) |
const |
|
inline |
TimeDeltaをk倍する
Multiply TimeDelta by double value.
◆ operator+() [1/2]
TimeDelta EZ::TimeDelta::operator+ |
( |
const long long & |
right | ) |
const |
|
inline |
TimeDeltaと整数秒を足し合わせる
Add TimeDelta object and integer seconds.
◆ operator+() [2/2]
2つのTimeDeltaを足し合わせる
Add two TimeDelta objects.
◆ operator/() [1/2]
TimeDelta EZ::TimeDelta::operator/ |
( |
const double & |
right | ) |
const |
|
inline |
TimeDeltaを1/k倍する
Divide TimeDelta object by double value.
◆ operator/() [2/2]
double EZ::TimeDelta::operator/ |
( |
const TimeDelta & |
right | ) |
const |
|
inline |
◆ set()
void EZ::TimeDelta::set |
( |
const long long & |
days, |
|
|
const long long & |
hours, |
|
|
const long long & |
minutes, |
|
|
const long long & |
seconds |
|
) |
| |
|
inline |
時刻差をセットする(日数, 時間数, 分の数, 秒数)
Set the time difference in the order of (days, hours, minutes, seconds).
- Parameters
-
[in] | days | |
[in] | hours | |
[in] | minutes | |
[in] | seconds | |
ex: -3days, -4hours, 5mins => set(-3, -4, 5, 0)
◆ str()
std::string EZ::TimeDelta::str |
( |
| ) |
const |
|
inline |
時刻差を以下のフォーマットの文字列で返却する
Return the time difference as a string such as the following format.
ex: TimeDelta(days=3, hours=4, minutes=5, seconds=0)
◆ totalDays()
long long EZ::TimeDelta::totalDays |
( |
| ) |
const |
|
inline |
時刻差を日数で返す(1日未満は切り捨て)
Return the time difference in days. (Truncate less than 1 day)
◆ totalHours()
long long EZ::TimeDelta::totalHours |
( |
| ) |
const |
|
inline |
時刻差を時間数で返す(1時間未満は切り捨て)
Return the time difference in hours. (Truncate less than 1 hour)
◆ totalMinutes()
long long EZ::TimeDelta::totalMinutes |
( |
| ) |
const |
|
inline |
時刻差を分で返す(1分未満は切り捨て)
Return the time difference in minutes. (Truncate less than 1 minute)
◆ totalSeconds()
long long EZ::TimeDelta::totalSeconds |
( |
| ) |
const |
|
inline |
時刻差を秒数で返す
Return the time difference in seconds.
◆ totalWeeks()
long long EZ::TimeDelta::totalWeeks |
( |
| ) |
const |
|
inline |
時刻差を週数で返す(7日未満は切り捨て)
- Return the time difference in weeks. (Truncate less than 7 days)
◆ toVector()
std::vector<long long> EZ::TimeDelta::toVector |
( |
| ) |
const |
|
inline |
時刻差を[日, 時, 分, 秒]の4つの要素をもつvectorとして返却する
Return the time difference as a vector with four elements {day, hour, minute, second}.
ex: {3, 4, 5, 0} => 3days, 4hours, 5mins
The documentation for this class was generated from the following file: