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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user