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

This commit is contained in:
2017-02-28 15:23:30 +00:00
parent be4df6903c
commit 749a7f2f48
2 changed files with 21 additions and 2 deletions

View File

@@ -310,6 +310,17 @@ PIString PIDateTime::toString(const PIString & format) const {
#ifdef WINDOWS
PIDateTime::PIDateTime(SYSTEMTIME t) {
year = t.wYear;
month = t.wMonth;
day = t.wDay;
hours = t.wHour;
minutes = t.wMinute;
seconds = t.wSecond;
milliseconds = t.wMilliseconds;
}
PIDateTime::PIDateTime(FILETIME t) {
FILETIME lt;
SYSTEMTIME st;
@@ -325,8 +336,7 @@ PIDateTime::PIDateTime(FILETIME t) {
}
FILETIME PIDateTime::toFILETIME() const {
FILETIME lt, ret;
SYSTEMTIME PIDateTime::toSYSTEMTIME() const {
SYSTEMTIME st;
st.wYear = year;
st.wMonth = month;
@@ -335,6 +345,13 @@ FILETIME PIDateTime::toFILETIME() const {
st.wMinute = minutes;
st.wSecond = seconds;
st.wMilliseconds = milliseconds;
return st;
}
FILETIME PIDateTime::toFILETIME() const {
FILETIME lt, ret;
SYSTEMTIME st = toSYSTEMTIME();
SystemTimeToFileTime(&st, &lt);
LocalFileTimeToFileTime(&lt, &ret);
return ret;

View File

@@ -228,7 +228,9 @@ struct PIP_EXPORT PIDateTime {
PIDateTime(const PIDate & date) {year = date.year; month = date.month; day = date.day; hours = minutes = seconds = milliseconds = 0;}
PIDateTime(const PIDate & date, const PITime & time) {year = date.year; month = date.month; day = date.day; hours = time.hours; minutes = time.minutes; seconds = time.seconds; milliseconds = time.milliseconds;}
#ifdef WINDOWS
PIDateTime(SYSTEMTIME t);
PIDateTime(FILETIME t);
SYSTEMTIME toSYSTEMTIME() const;
FILETIME toFILETIME() const;
#endif
int year;