date modified hour and zip files in DST timezone

English support forum

Moderators: white, Hacker, petermad, Stefan2

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 »

Horst.Epp,
The quesstion is not how to increase FAT timestamp resolution but how to keep seeing local timestamp for files instead of it jumping around based on summer time or time zone.

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.
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 »

Horst.Epp wrote: 2023-10-19, 13:14 UTC
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.
What about file managers that can use Zip packaging as ExFAT ?
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 »

Hacker wrote: 2023-10-19, 14:08 UTC Horst.Epp,
The quesstion is not how to increase FAT timestamp resolution but how to keep seeing local timestamp for files instead of it jumping around based on summer time or time zone.

Roman
Thats right how to stop DST hour changes affecting either files within the zip or files when extracted from zip.

From my observation file with times ending in odd numbers -- 1,3,5,7,9 zip subtracts 1 second from files having these times.
for files with times ending in even numbers --0,2,4,6,8 zip doesn't change timestamps of these files

What about using something like this ? https://github.com/DinoChiesa/DotNetZip

so is there someway to add 1 second to those odd time files during the zip process so that the files are consistent ?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6497
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: date modified hour and zip files in DST timezone

Post by *Horst.Epp »

Hacker wrote: 2023-10-19, 14:08 UTC Horst.Epp,
The quesstion is not how to increase FAT timestamp resolution but how to keep seeing local timestamp for files instead of it jumping around based on summer time or time zone.

Roman
I know, but he said
"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"
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
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 »

Horst.Epp wrote: 2023-10-19, 15:38 UTC
Hacker wrote: 2023-10-19, 14:08 UTC Horst.Epp,
The quesstion is not how to increase FAT timestamp resolution but how to keep seeing local timestamp for files instead of it jumping around based on summer time or time zone.

Roman
I know, but he said
"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"
I've tested both even and odd second times and my conclusion is that zip does not preserve odd seconds. Zip only preserves even seconds. The question now becomes, is there ANY process by which to preserve odd second time files with total commander's version of zip?
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 »

FAT has no higher time resolution, TC or any other file manager can't change that.
Yes, and neither does ZIP, TC cannot change that either.
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, 20:05 UTC Yes, and neither does ZIP, TC cannot change that either.
What about any pre-processing scripts ?
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 »

Apparently it is possible to store NTFS timestamps in so called "Extra" fields - but doing that might make the file incompatible for extraction with for.example Windows Explorer - or you might just get the FAT timestamp in that case - I don't know.
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
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 »

Horst.Epp,
I know, but he said
"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"
I think that's exactly what I said, just in other words.

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
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,
What about any pre-processing scripts ?
You could save the timestamps in some batch file in the zip archive and run it to restore the correct time stamps after unpacking.

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.
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, 20:58 UTC Apparently it is possible to store NTFS timestamps in so called "Extra" fields - but doing that might make the file incompatible for extraction with for.example Windows Explorer - or you might just get the FAT timestamp in that case - I don't know.
Do you know how to test this ?
Hacker wrote: 2023-10-19, 21:05 UTC anmac1789,
What about any pre-processing scripts ?
You could save the timestamps in some batch file in the zip archive and run it to restore the correct time stamps after unpacking.

Roman
But, that's the same thing as using any file attribute changer software to change the source files before packing and the files are unpacking. Is there some process to do it during the zipping process as like some pre command ? Like if I was total commander and there is somekind of option to run a batch command during the zip process...okay check file1.jpg date modified has odd second, add +1 second, zip, subtract -1 second etc...
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,
that's the same thing as using any file attribute changer software to change the source files before packing
No, it is not, because when you only have packed files, you don't know what the original time was anymore. When you have packed file

Code: Select all

file1.jpg 12:40:32
what do you set the time after unpacking? 12:40:32? 12:40:31? 12:40:33?
When you also pack "timestampinfo.txt" with contents

Code: Select all

file1.jpg=12:40:31
file2.jpg=12:45:27
then you can restore timestamps correctly.

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 »

Well, even if timestamps for the same files are stored with 1 second difference, TC considers them equal when comparing either with Shift+F2 or with the Sync tool.

Example with NFTS on on the left and exFAT on the right side: https://tcmd.madsenworld.dk/comparetimestamps1secdiff.png where 3 files have timestamps with a 1 second difference.
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 »

Hacker wrote: 2023-10-20, 07:59 UTC anmac1789,
that's the same thing as using any file attribute changer software to change the source files before packing
No, it is not, because when you only have packed files, you don't know what the original time was anymore. When you have packed file

Code: Select all

file1.jpg 12:40:32
what do you set the time after unpacking? 12:40:32? 12:40:31? 12:40:33?
When you also pack "timestampinfo.txt" with contents

Code: Select all

file1.jpg=12:40:31
file2.jpg=12:45:27
then you can restore timestamps correctly.

Roman
ok so how do i use this text file to restore odd second timestamps ?
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,
how do i use this text file to restore odd second timestamps ?
You could e.g. include the NirCmd utility in the archive and then run a RestoreCorrectTimes.cmd, which would contain the commands to correct the timestamps, something like:

Code: Select all

nircmdc.exe setfiletime file1.jpg "" "28-08-2023 12:40:31"
nircmdc.exe setfiletime file2.jpg "" "28-08-2023 12:45:27"
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.
Post Reply