Copy Full Date&Time (with seconds) into a txt file

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Marok
Junior Member
Junior Member
Posts: 2
Joined: 2024-11-13, 20:21 UTC

Copy Full Date&Time (with seconds) into a txt file

Post by *Marok »

Hello!
I'm a registered user of Total Commander since 20+ years and I really like it.
Now, I'm looking for a command that's really similar to cm_CopyFullNamesToClip:

I need to copy into a text file the DATE and TIME (with seconds!) of all files of a directory.

I specify "with seconds" because, otherwise, standard "dir /b" command in a dos batch file would be good enough.
Someone knows if something like that already exists?

(A solution that includes Nir Commander or any other software would also be ok, but I haven't found anything anywhere!)

A brilliant alternative solution could be to search results for *.*, then open into panel (with seconds, using the "custom columns" option) and then log the panel results into a file, but I've no idea about how to do that.
If it exits any way to copy into a log file the panel results, like we can easily do with simple search results, we've done!

Thanks you a lot!
User avatar
beb
Power Member
Power Member
Posts: 579
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Copy Full Date&Time (with seconds) into a txt file

Post by *beb »

2Marok
set up a custom view, and include a column like this:
Contents*=[=tc.writedate.Y.M.D h:m:s]

Make a button like like this:

Code: Select all

TOTALCMD#BAR#DATA
cm_CopyFileDetailsToClip

wcmicon.dll,19
Clipboard: Data >>

0
2036
[/s]
Oh, as Dalai pointed out, there's even a ready-to-go built-in menu entry for this.

Select the files/folders in question, hit the button menu (see Dalai's message), open your preferred text editor, and paste data there.

That's one of the ways.

And this is how it might look:
https://i.imgur.com/ROhs2Tq.mp4

Edit. regarding Dalai's input.
Last edited by beb on 2024-11-13, 21:23 UTC, edited 3 times in total.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
User avatar
Dalai
Power Member
Power Member
Posts: 9945
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Copy Full Date&Time (with seconds) into a txt file

Post by *Dalai »

You can use the command cm_CopyFileDetailsToClip which is available via menu Mark > Copy To Clipboard With All Details. Since TC 10.50 this command also supports optional parameters:

Code: Select all

12.04.22 Release Total Commander 10.50 beta 1
[...]
09.03.22 Added: cm_CopyFileDetailsToClip, cm_CopyHdrFileDetailsToClip etc. now accept parameter to copy only specific columns (1=name+ext, 2=first custom, 4=second custom etc.) in normal, comments, and custom columns view. Parameter 1 alone copies full list with headers, for backwards compatibility (32/64)
#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
Marok
Junior Member
Junior Member
Posts: 2
Joined: 2024-11-13, 20:21 UTC

Re: Copy Full Date&Time (with seconds) into a txt file

Post by *Marok »

WOW!!! It works!

Thanks both *beb and dalai for your quick and brilliant help, you're really great!!!
User avatar
petermad
Power Member
Power Member
Posts: 16001
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Copy Full Date&Time (with seconds) into a txt file

Post by *petermad »

2Marok
With TC 10.50 you don't even have to make a custom view, you can choose to have the seconds displayed in Full View via "Configuration" -> "Tabstops/Data formats" -> "Date format" - > "hh:mm:ss"
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
User avatar
nsp
Power Member
Power Member
Posts: 1912
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Copy Full Date&Time (with seconds) into a txt file

Post by *nsp »

A little bit late but you can achieve it also with TCBL. See forum.
in a tcbl.ini add a section like:

Code: Select all

[dateIntxt]
; output file in first parameter
ini=o $1\FileDate.txt
;Date/Time Format
ini=# %m/%d/%Y %H:%M:%S
ini=x
ini=q
ini=K
;output file and modification date (File without path use $n)
cmd=$f	$#m
if you install tcbl in a tool\tcbl folder under %commander_path%, you ca create such button !

Code: Select all

TOTALCMD#BAR#DATA
%commander_path%\tools\tcbl\tcbl.exe
-i %L dateIntxt %T
%systemroot%\system32\imageres.dll,273
Save modification date to FileDate.txt in %T (Target folder) 
%P
0
-1
Select all the files you want to list and click on the button.
Post Reply