PIScreen windows optimization, expanded pisd copy dialog

git-svn-id: svn://db.shs.com.ru/pip@90 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-04-11 14:13:03 +00:00
parent b82453d845
commit 493d8ba0c7
8 changed files with 151 additions and 43 deletions

View File

@@ -159,6 +159,18 @@ PITime PITime::current() {
}
PITime PITime::fromSystemTime(const PISystemTime & st) {
double s = st.toSeconds();
int v = s;
PITime ret;
ret.milliseconds = (s - v) * 1000;
ret.seconds = v % 60; v = (v - ret.seconds) / 60;
ret.minutes = v % 60; v = (v - ret.minutes) / 60;
ret.hours = v;
return ret;
}
PIDate PIDate::current() {
time_t rt = ::time(0);
tm * pt = localtime(&rt);

View File

@@ -190,6 +190,7 @@ struct PIP_EXPORT PITime {
int milliseconds;
PIString toString(const PIString & format = "h:mm:ss") const;
static PITime current();
static PITime fromSystemTime(const PISystemTime & st);
};
PIP_EXPORT bool operator ==(const PITime & t0, const PITime & t1);
PIP_EXPORT bool operator <(const PITime & t0, const PITime & t1);