date modified hour and zip files in DST timezone

English support forum

Moderators: white, Hacker, petermad, Stefan2

anmac1789
Junior Member
Junior Member
Posts: 36
Joined: 2020-11-30, 01:33 UTC

date modified hour and zip files in DST timezone

Post by *anmac1789 »

Hello, I have a question regarding files on my win 10. Currently (as of Oct 18, 2023) I live in the EDT timezone (UTC-4) in Northern US & Canada. I have a zip file with summer and winter dated pictures and when extracted the date modified is ahead of the date taken by 1 hour. When I toggle on/off 'adjust for daylight saving time automatically' then the date modified hour goes back and forth by 1 hour. How can I keep it consistent all throughout the year?

1. What if I extracted a file with summer/spring dates during the autumn/winter months, when my timezone ends DST and we switch from EDT to EST. What happens to the date modified hour?

2. What if I extracted a file with autumn/winter dates during the spring/summer months, when my timezone starts DST and we switch from EST to EDT. What happens to the date modified hour?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: date modified hour and zip files in DST timezone

Post by *ghisler(Author) »

ZIP files store file times as local time, while the NTFS file system stores them as UTC (universal time). So when switching from/to daylight saving time, either the first or the second will change by one hour.

Total Commander has an option in Configuration - Options - Operation to ignore a time difference of exactly one hour.
Author of Total Commander
https://www.ghisler.com
anmac1789
Junior Member
Junior Member
Posts: 36
Joined: 2020-11-30, 01:33 UTC

Re: date modified hour and zip files in DST timezone

Post by *anmac1789 »

ghisler(Author) wrote: 2023-10-18, 09:40 UTC ZIP files store file times as local time, while the NTFS file system stores them as UTC (universal time). So when switching from/to daylight saving time, either the first or the second will change by one hour.

Total Commander has an option in Configuration - Options - Operation to ignore a time difference of exactly one hour.
So for files having summer dates for example, extracted during winter and waiting until DST starts next year, will have the date modified hour forwarded by one hour ?

basically the question becomes: What happens to files having EDT timezone (UTC-4) date modified extracted from .zip archives in EST (UTC-5) timezone ? and vice versa?

What does Operation to ignore a time difference of exactly one hour exactly do ?
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: date modified hour and zip files in DST timezone

Post by *sqa_wizard »

Well, as said before:

ZIP stores the time as local time only (no timezone).
If you take a photo of sunrise at 6.00 UTC+6 in the morning, pack it as zip and you unpack it at a city at timezone UTC-6 you will still see 6.00 in the morning.
You see:
1. The sunrise photo is taken in the morning of the origin city.
2. You have to calculate your own, what time it was at your own city.

7-ZIP for instance stores the time as UTC (like NTFS file systems do).
If you take a photo of sunrise at 6.00 UTC+6 in the morning, pack it as 7z and you unpack it at a city at timezone UTC-6 you will now see 6.00 in the evening.
You see:
1. The sunrise photo is taken in the evening of your city.
2. You have to calculate your own, what time it was at the origin city.

Different methods have different advantages and draw-backs.
#5767 Personal license
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: date modified hour and zip files in DST timezone

Post by *Hacker »

anmac1789,
FYI, you can also experiment with wincmd.ini - [Configuration]
NewTimeZoneMethod=
1: Windows 7-style timezone method (default on Windows 7)
0: Old method (default on older Windows)
HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: date modified hour and zip files in DST timezone

Post by *petermad »

You can control it a litte by using NewTimeZoneMethod=0 in the [Configuration] section of wincmd.ini:
help wrote:NewTimeZoneMethod= 1 Windows 7-style timezone method (default on Windows 7)
0: Old method (default on older Windows)
https://ghisler.ch/board/viewtopic.php?p=399219#p399219
https://ghisler.ch/board/viewtopic.php?p=227606#p227606
https://ghisler.ch/board/viewtopic.php?p=325315#p325315
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
anmac1789
Junior Member
Junior Member
Posts: 36
Joined: 2020-11-30, 01:33 UTC

Re: date modified hour and zip files in DST timezone

Post by *anmac1789 »

sqa_wizard wrote: 2023-10-18, 18:06 UTC Well, as said before:

ZIP stores the time as local time only (no timezone).
If you take a photo of sunrise at 6.00 UTC+6 in the morning, pack it as zip and you unpack it at a city at timezone UTC-6 you will still see 6.00 in the morning.
You see:
1. The sunrise photo is taken in the morning of the origin city.
2. You have to calculate your own, what time it was at your own city.

7-ZIP for instance stores the time as UTC (like NTFS file systems do).
If you take a photo of sunrise at 6.00 UTC+6 in the morning, pack it as 7z and you unpack it at a city at timezone UTC-6 you will now see 6.00 in the evening.
You see:
1. The sunrise photo is taken in the evening of your city.
2. You have to calculate your own, what time it was at the origin city.

Different methods have different advantages and draw-backs.
sqa_wizard wrote: 2023-10-18, 18:06 UTCZIP stores the time as local time only (no timezone).
Well that's not completely true because, if i toggle 'adjust for daylight saving time automatically' in windows setting, the time flips back and forth an hour inside the zip file too (im using winrar to open .zip archive)

but my question is only regarding EST/EDT in UTC-5/UTC-4 timezones in Eastern Canada. Right now, I've experimented that toggling on/off 'adjust for daylight saving time automatically' in windows settings, doesn't change date modified hour of pictures taken during the winter for some reason. But for pictures taken during the spring/summer, always change. Why is this ? Is this behavour going to to happen to winter pictures in winter months ?
anmac1789
Junior Member
Junior Member
Posts: 36
Joined: 2020-11-30, 01:33 UTC

Re: date modified hour and zip files in DST timezone

Post by *anmac1789 »

What's even more stranger is that when adding files to a zip made with total commander, it's off by 1 second for some reason. WinRAR and 7zip don't have this problem. Is there something behind the scenes with total commander that it's not preserving the full timestamp including seconds ?

When using the zip packer, the files inside the .zip are not affected by DST changes. However, the seconds are -1. If somehow, this could be fixed, then the zip archive is complete with total commander.
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: date modified hour and zip files in DST timezone

Post by *petermad »

2anmac1789
when adding files to a zip made with total commander, it's off by 1 second for some reason.
Zip uses the same time stamp resolution as FAT partitions on a harddisk - FAT can only store even seconds, so if you copy a file with uneven seconds from a NTFS drive to a FAT drive, then 1 is added to the seconds.


https://devblogs.microsoft.com/oldnewthing/20151030-00/?p=91881
https://en.wikipedia.org/wiki/ZIP_%28file_format%29
WikiPedia wrote:The FAT filesystem of DOS has a timestamp resolution of only two seconds; ZIP file records mimic this. As a result, the built-in timestamp resolution of files in a ZIP archive is only two seconds, though extra fields can be used to store more precise timestamps. The ZIP format has no notion of time zone, so timestamps are only meaningful if it is known what time zone they were created in.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
anmac1789
Junior Member
Junior Member
Posts: 36
Joined: 2020-11-30, 01:33 UTC

Re: date modified hour and zip files in DST timezone

Post by *anmac1789 »

petermad wrote: 2023-10-19, 07:25 UTC 2anmac1789
when adding files to a zip made with total commander, it's off by 1 second for some reason.
Zip uses the same time stamp resolution as FAT partitions on a harddisk - FAT can only store even seconds, so if you copy a file with uneven seconds from a NTFS drive to a FAT drive, then 1 is added to the seconds.


https://devblogs.microsoft.com/oldnewthing/20151030-00/?p=91881
https://en.wikipedia.org/wiki/ZIP_%28file_format%29
WikiPedia wrote:The FAT filesystem of DOS has a timestamp resolution of only two seconds; ZIP file records mimic this. As a result, the built-in timestamp resolution of files in a ZIP archive is only two seconds, though extra fields can be used to store more precise timestamps. The ZIP format has no notion of time zone, so timestamps are only meaningful if it is known what time zone they were created in.
So are you going to increase time resolution to include odd and even seconds ? but without timezone information ? How to fix this ? Also, the source file is on a windows network drive from using a webdav server app on android
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: date modified hour and zip files in DST timezone

Post by *Dalai »

anmac1789 wrote: 2023-10-19, 12:03 UTCHow to fix this ?
Use an appropriate archive format like 7Z or RAR which can store precise timestamps and save them in UTC.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: date modified hour and zip files in DST timezone

Post by *petermad »

So are you going to increase time resolution
I am not going to to do anything - I am just pointing out that in ZIP files, seconds are only stored as even numbers by default - it has nothing to do with TC, it is a limitation for the ZIP format.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
anmac1789
Junior Member
Junior Member
Posts: 36
Joined: 2020-11-30, 01:33 UTC

Re: date modified hour and zip files in DST timezone

Post by *anmac1789 »

But i dont want the times to change under DST when i extract from zip but i do want slightly higher second resolution is this possible ?
anmac1789
Junior Member
Junior Member
Posts: 36
Joined: 2020-11-30, 01:33 UTC

Re: date modified hour and zip files in DST timezone

Post by *anmac1789 »

Dalai wrote: 2023-10-19, 12:19 UTC
anmac1789 wrote: 2023-10-19, 12:03 UTCHow to fix this ?
Use an appropriate archive format like 7Z or RAR which can store precise timestamps and save them in UTC.

Regards
Dalai
I prefer the FAT like behaviour of timestamps in the sense that it doesnt change when DST on or off but i want higher time resolution without the timezone information or UTC timestamps
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6498
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: date modified hour and zip files in DST timezone

Post by *Horst.Epp »

anmac1789 wrote: 2023-10-19, 12:27 UTC I prefer the FAT like behaviour of timestamps in the sense that it doesnt change when DST on or off but i want higher time resolution without the timezone information or UTC timestamps
Accept the facts.
FAT has no higher time resolution, TC or any other file manager can't change that.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
Post Reply