List Archive
Thread
-
zip_file_set_mtime() bug?,
Andreas Falkenhahn
(2017/11/15 16:48:10)
-
Re: zip_file_set_mtime() bug?,
Thomas Klausner
(2017/11/15 17:39:51)
-
Re: zip_file_set_mtime() bug?,
Andreas Falkenhahn
(2017/11/15 18:17:12)
- Re: zip_file_set_mtime() bug?, Thomas Klausner (2017/11/15 18:50:58)
- Re: zip_file_set_mtime() bug?, Andreas Falkenhahn (2017/11/15 19:57:26)
-
Re: zip_file_set_mtime() bug?,
Andreas Falkenhahn
(2017/11/15 18:17:12)
-
Re: zip_file_set_mtime() bug?,
Thomas Klausner
(2017/11/15 17:39:51)
Message
On Wed, Nov 15, 2017 at 07:17:10PM +0100, Andreas Falkenhahn wrote: > On 15.11.2017 at 18:39 Thomas Klausner wrote: > > > On Wed, Nov 15, 2017 at 05:48:07PM +0100, Andreas Falkenhahn wrote: > > >> I want to set the datestamp of a file inside a zip archive to > >> 16-Sep-2017 08:34:56. This is my code: > > >> struct tm tm; > > >> tm.tm_sec = 56; > >> tm.tm_min = 34; > >> tm.tm_hour = 8; > >> tm.tm_mday = 16; > >> tm.tm_mon = 8; > >> tm.tm_year = 117; > >> tm.tm_isdst = -1; > >> > >> zip_file_set_mtime(arc, 0, mktime(&tm), 0); > >> > >> When I compile and run this code on Linux, Ubuntu shows the > >> file date correctly as 16-Sep-2017 08:34:56. > > >> When I compile and run this code on Windows, however, Windows > >> Explorer shows the file date as 16-Sep-2017 09:34:56, i.e. > >> one hour later than what I passed to zip_file_set_mtime(). > > >> Is this a bug in libzip or am I doing something wrong here? > > > libzip doesn't behave differently in this code path for the two > > operating systems. > > > I'd take a closer look at what you get from mktime() on the two > > systems. > > It's the same. So when I open the zip archive created on Ubuntu > with Windows Explorer, Explorer also reports 09:34:56 whereas Ubuntu > reports 08:34:56. Any idea what is the reason for that? Why > does Windows Explorer add an hour? I'm guessing that it thinks the time inside the zip archive is UTC, and that you're in CET (= UTC+1), so it adds one hour when displaying the time. Thomas
Made by MHonArc.