date modified hour and zip files in DST timezone
Moderators: Hacker, petermad, Stefan2, white
date modified hour and zip files in DST timezone
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?
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?
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: date modified hour and zip files in DST timezone
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.
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
https://www.ghisler.com
Re: date modified hour and zip files in DST timezone
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 ?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.
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 ?
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Re: date modified hour and zip files in DST timezone
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.
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
Re: date modified hour and zip files in DST timezone
anmac1789,
FYI, you can also experiment with wincmd.ini - [Configuration]
Roman
FYI, you can also experiment with wincmd.ini - [Configuration]
HTHNewTimeZoneMethod=
1: Windows 7-style timezone method (default on Windows 7)
0: Old method (default on older Windows)
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.
Re: date modified hour and zip files in DST timezone
You can control it a litte by using NewTimeZoneMethod=0 in the [Configuration] section of wincmd.ini:
https://ghisler.ch/board/viewtopic.php?p=227606#p227606
https://ghisler.ch/board/viewtopic.php?p=325315#p325315
https://ghisler.ch/board/viewtopic.php?p=399219#p399219help 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=227606#p227606
https://ghisler.ch/board/viewtopic.php?p=325315#p325315
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: date modified hour and zip files in DST timezone
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.
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 ?
Re: date modified hour and zip files in DST timezone
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.
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.
Re: date modified hour and zip files in DST timezone
2anmac1789
https://devblogs.microsoft.com/oldnewthing/20151030-00/?p=91881
https://en.wikipedia.org/wiki/ZIP_%28file_format%29
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.when adding files to a zip made with total commander, it's off by 1 second for some reason.
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.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: date modified hour and zip files in DST timezone
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 androidpetermad wrote: 2023-10-19, 07:25 UTC 2anmac1789Zip 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.when adding files to a zip made with total commander, it's off by 1 second for some reason.
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.
Re: date modified hour and zip files in DST timezone
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: date modified hour and zip files in DST timezone
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.So are you going to increase time resolution
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: date modified hour and zip files in DST timezone
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 ?
Re: date modified hour and zip files in DST timezone
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
Re: date modified hour and zip files in DST timezone
Accept the facts.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
FAT has no higher time resolution, TC or any other file manager can't change that.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64