summaryrefslogtreecommitdiff
path: root/plugins/Db_autobackups
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-23 16:31:35 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-23 16:31:35 +0300
commit0859890fad590ab9be7ec10e594fe17927a7b3f8 (patch)
tree9c1467e44c149f7158f108badd1c90078e00e7a7 /plugins/Db_autobackups
parentffaa9ee5d7e7c741a00d479734c630cece1e7664 (diff)
fixes #1646 (Db_autobackuper: wrong archieve time)
Diffstat (limited to 'plugins/Db_autobackups')
-rw-r--r--plugins/Db_autobackups/src/zip.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/Db_autobackups/src/zip.cpp b/plugins/Db_autobackups/src/zip.cpp
index 4952cedc20..cd3e0187ef 100644
--- a/plugins/Db_autobackups/src/zip.cpp
+++ b/plugins/Db_autobackups/src/zip.cpp
@@ -12,11 +12,12 @@ int CreateZipFile(const wchar_t *szDestPath, OBJLIST<ZipFile> &lstFiles, const s
for (auto &zf : lstFiles) {
HANDLE hSrcFile = CreateFileW(zf->sPath.c_str(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
if (hSrcFile != INVALID_HANDLE_VALUE) {
- FILETIME ft;
+ FILETIME ft, ft2;
GetFileTime(hSrcFile, 0, &ft, 0);
+ FileTimeToLocalFileTime(&ft, &ft2);
WORD dosDate, dosTime;
- FileTimeToDosDateTime(&ft, &dosDate, &dosTime);
+ FileTimeToDosDateTime(&ft2, &dosDate, &dosTime);
fi.dosDate = MAKELONG(dosTime, dosDate);
int iOpenRes = zipOpenNewFileInZip(hZip, _T2A(zf->sZipPath.c_str()), &fi, nullptr, 0, nullptr, 0, "", Z_DEFLATED, Z_BEST_COMPRESSION);