git-svn-id: svn://db.shs.com.ru/pip@282 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2016-11-23 10:59:53 +00:00
parent d3166f8fa5
commit 8f6e7d2cae
9 changed files with 73 additions and 36 deletions

View File

@@ -148,6 +148,11 @@ bool operator >(const PIDateTime & t0, const PIDateTime & t1) {
}
PISystemTime PITime::toSystemTime() const {
return PISystemTime((hours * 60. + minutes) * 60. + seconds, milliseconds * 1000.);
}
PITime PITime::current() {
time_t rt = ::time(0);
tm * pt = localtime(&rt);

View File

@@ -192,6 +192,7 @@ struct PIP_EXPORT PITime {
int seconds;
int milliseconds;
PIString toString(const PIString & format = "h:mm:ss") const;
PISystemTime toSystemTime() const;
static PITime current();
static PITime fromSystemTime(const PISystemTime & st);
};