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

Re: date modified hour and zip files in DST timezone

Post by *anmac1789 »

Hacker wrote: 2023-10-20, 16:52 UTC 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"
What do you mean by “ You could e.g. include the NirCmd utility in the archive” ?? is the .cmd file you refer to inside the archive or is it used outside the archive after unpacking the files ?
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,
To set the correct timestamps after unpacking, you will need both the nircmd utility and the .cmd batch file. I would suggest to include them in the archive so they do not get lost, but yes, they get used after unpacking the archive. It is not necessary to include them in the archive, only convenient.

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 »

Hacker wrote: 2023-10-21, 16:25 UTC anmac1789,
To set the correct timestamps after unpacking, you will need both the nircmd utility and the .cmd batch file. I would suggest to include them in the archive so they do not get lost, but yes, they get used after unpacking the archive. It is not necessary to include them in the archive, only convenient.

Roman
What if I have like thousands of pictures and videos ?
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: date modified hour and zip files in DST timezone

Post by *Gral »

Pure TC solution.
Write datetime to comment, pack "descript.ion" with files.
After unpack write comment to writedatetime.
Create two buttons for instant write.
------------------------------------
Add to WINCMD.INI file

Code: Select all

[attrplugin]
Writedate2Comment=tc.comment := "[=tc.writedate.Y-M-D h-m-s]"
Comment2Writedate=tc.writedate := [=tc.comment]
------------------------------------
Modification for line "Writedate2Comment" may be needed depending on your system settings
------------------------------------

Add to USERCMD.INI

Code: Select all

[em_writedate2comment]
cmd=OPENATTRIBUTES=
param=Writedate2Comment

[em_comment2writedate]
cmd=OPENATTRIBUTES=
param=Comment2Writedate
------------------------------------
Add buttons to buttonbar

Code: Select all

TOTALCMD#BAR#DATA
em_writedate2comment

wcmicons.dll


0
10000

Code: Select all

TOTALCMD#BAR#DATA
em_comment2writedate

wcmicons.dll


0
10001
Works for branch view and for search result panel.
You always need to select files before the action!
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 if I have like thousands of pictures and videos ?
Then the .cmd file will have thousands of lines.

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 »

Holy crap this looks complicated hold on let me digest this. Has anyone tried this ?
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 »

Assuming that I have the original files even after packing files to zip, is there a way to change files or folders with odd second timestamps inside the zip archive ? even by mounting the zip as a local drive using winarchiver pro or some other software
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,
is there a way to change files or folders with odd second timestamps inside the zip archive
No. The .zip file doesn't know what odd timestamps are, there is no way to store them. To a .zip file, an odd timestamp does not and cannot exist.

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 »

Hacker wrote: 2023-12-29, 19:37 UTC anmac1789,
is there a way to change files or folders with odd second timestamps inside the zip archive
No. The .zip file doesn't know what odd timestamps are, there is no way to store them. To a .zip file, an odd timestamp does not and cannot exist.

Roman
Ok, maaan i wish phil katz wasnt so drunk he wpuldve lived to improve on the zip format
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) »

It's not his fault, ZIP uses the FAT32 date format which cannot store odd seconds.
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-12-31, 11:08 UTC It's not his fault, ZIP uses the FAT32 date format which cannot store odd seconds.
How come total commander cant use extended timetamps when making zip files ?
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) »

Extended timestamps would be stored in an extra header and would therefore make the ZIP file larger.
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: 2024-01-02, 10:54 UTC Extended timestamps would be stored in an extra header and would therefore make the ZIP file larger.
But even then wouldnt it beneficial at the cost of extra file size ?
Post Reply