Request to add a variable with date and time in Total Commander 11

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

PiotrMPPL
Junior Member
Junior Member
Posts: 44
Joined: 2018-10-26, 07:04 UTC

Request to add a variable with date and time in Total Commander 11

Post by *PiotrMPPL »

Hi

Request to add a variable with date and time in Total Commander 11

ex. YYYYMMDDhhmmss
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Request to add a variable with date and time in Total Commander 11

Post by *Stefan2 »

  
2PiotrMPPL

Where would you use that? And how?


There is already


a) For Shift+F4 and F7 there are this templates: <[YMD] <[hms] behind the button on the right.


b) The WDX content plugin "filesys" (filesys sample plugin v2.5 from 31.Jan.2019)
adds new fields "Today" and "Yesterday" give back a Boolean "Yes" or "No"
[=filesys.Today]
[=filesys.Yesterday]

This works fine for Search for files created "Today" and "Yesterday",
and so for "Color by filetype" files created "Today" and "Yesterday" too.


c) For MRT, to add the current date&time, we can use [T3]:
[N]-backup created at [T3] [YMD] - [hms]





d) Left over the TC command line and the button parameter box.

03.05.23 Release Total Commander 11.00 beta 1
26.04.23 Added: Command line parameters (button bar, start menu): New parameter %|envvar|
inserts environment variable envvar, e.g. %|windir| or %|$DESKTOP| in the parameter field (32/64)

So I have something to play around this weekend ;.)
and to test if %|date| and %|time| or %|myOwnTimestamp| will work.

Could be need/neat for a simple command line usage w/o the need for external batch/script:
7z.exe -x "%P" -o "backup of %N - %|myOwnTimestamp|.7z"


 
PiotrMPPL
Junior Member
Junior Member
Posts: 44
Joined: 2018-10-26, 07:04 UTC

Re: Request to add a variable with date and time in Total Commander 11

Post by *PiotrMPPL »

Why can't you add the TC timestamp yyyymmddhhmmss and not use the script?
User avatar
Dalai
Power Member
Power Member
Posts: 9388
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Request to add a variable with date and time in Total Commander 11

Post by *Dalai »

Can you name an example (or multiple) of where in TC such variable is missing? As Stefan2 already pointed out that the MRT, Shift+F4 and F7 dialogs can use such variables.

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
PiotrMPPL
Junior Member
Junior Member
Posts: 44
Joined: 2018-10-26, 07:04 UTC

Re: Request to add a variable with date and time in Total Commander 11

Post by *PiotrMPPL »

But not for the button
User avatar
Dalai
Power Member
Power Member
Posts: 9388
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Request to add a variable with date and time in Total Commander 11

Post by *Dalai »

It would be much easier if you said what you mean in a more complete way.

Anyway, puzzling together the little pieces of information given, I guess what you want is another pre-defined placeholder [YMDhms] that combines the already existing seperate placeholders [YMD] and [hms]. If that's true, I can say that once you used the existing [YMD][hms] that string will be in the history of the specific dialog (MRT, Shift+F4 and F7 all save their history independently). OTOH I think that it could be beneficial to have another combined placeholder. Still it would be required to know WHERE you miss this placeholder.

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
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: Request to add a variable with date and time in Total Commander 11

Post by *Gral »

As I am guessing it's to be used as a parameter in buttons, user commands and start menu similar to system %DATE% %TIME% variables.
I can even guess further - e.g. to create archive names from the command line with the current date.
User avatar
tuska
Power Member
Power Member
Posts: 3760
Joined: 2007-05-21, 12:17 UTC

Re: Request to add a variable with date and time in Total Commander 11

Post by *tuska »

Example for the use of a button.
  1. Multi-Rename Tool... Ctrl+M
    1. Rename mask: file name: [YMDhms]_[N]
    2. Save settings: YYYYMMDDhhmmss
  2. Button with command ... "MULTIRENAME==YYYYMMDDhhmmss" | test.txt --> 20230512191432_test.txt
    Help - F1: Search for -> MULTIRENAME -> double-click on: Dialog box: Configuration: Change button bar > Command ... 12.

    Code: Select all

    TOTALCMD#BAR#DATA
    MULTIRENAME==YYYYMMDDhhmmss
    
    wciconex.dll,5
    MULTIRENAME==YYYYMMDDhhmmss|Multi-Rename Tool... Ctrl+M || Rename mask: file name: [YMDhms]_[N]|https://www.ghisler.ch/board/viewtopic.php?t=78993|Renaming starts immediately and the multi-rename tool will close if there were no errors.|Undo is possible.
    
    
    -1
    
  3. Create a Button in the Buttonbar (copy/paste CODE)
    1. Click on "SELECT ALL" (to the right of CODE:), then press CTRL+C (copy to clipboard).
    2. Right-click on any place in the button bar, then click on "Paste".
       ⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺
    3. Option1: Point to the new button (slightly longer): 'Tooltip' is shown (-> description to the button).
                    A maximum of 259 characters is allowed for the tooltip. | = create line break, || = create | as separator character.
    4. Option2: Button bar - "Tooltip" field: A single space deactivates the display of the tooltip.
                    If the "Tooltip" field is empty, the content of the "Command" field is displayed.
    5. Option3: See FAQs and explanation: Button-code (TOTALCMD#BAR#DATA)  <-- <Ctrl+click on the link...>
Fla$her
Power Member
Power Member
Posts: 2309
Joined: 2020-01-18, 04:03 UTC

Re: Request to add a variable with date and time in Total Commander 11

Post by *Fla$her »

PiotrMPPL wrote: 2023-05-12, 13:22 UTCWhy can't you add the TC timestamp yyyymmddhhmmss and not use the script?
What do you mean by scripts? Parameters to %ComSpec% or nircmd are scripts in your opinion?

Stefan2 wrote: 2023-05-12, 13:17 UTC So I have something to play around this weekend ;.)
and to test if %|date| and %|time| or %|myOwnTimestamp| will work.
Of course, they won't work. Don't waste your time. When requesting such syntax, I meant only EnVars.
Gral wrote: 2023-05-12, 16:45 UTCAs I am guessing it's to be used as a parameter in buttons, user commands and start menu similar to system %DATE% %TIME% variables.
I don't even doubt that it's about that. Only there are no such system environment variables, these variables relate exclusively to cmd.exe.
And the most basic problem will be the naming of such parameters. %Y, %y, %M, %D, %d, %S, %s are occupied. Only %h and %m remain. But it would be possible to double the letters: %YY, %MM, %DD, etc.
Gral wrote: 2023-05-12, 16:45 UTCI can even guess further - e.g. to create archive names from the command line with the current date.
Including. WinRAR, by the way, has a built-in parameter.
Overquoting is evil! 👎
hi5
Power Member
Power Member
Posts: 551
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: Request to add a variable with date and time in Total Commander 11

Post by *hi5 »

My proposal %K ("Kurrent time?") YYYYMMDDHH24MISS with substring fields and additional options
Date/time as new Parameters for Button bar, user cmd
https://www.ghisler.ch/board/viewtopic.php?t=75669
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Request to add a variable with date and time in Total Commander 11

Post by *beb »

Support this.
With the adjustable/flexible syntax (e.g., if I steal the %K from the above u/hi5 post):
%K "{yyyyMMddTHHmm}"
%K "{yyyyMMddTHHmmssfff}"
%K "{yyyy-MM-dd HH:mm:ss.ffff}"

Code: Select all

# Get-Date (formats)
# https://learn.microsoft.com/en-ca/powershell/module/Microsoft.PowerShell.Utility/Get-Date
# yyyyMMddTHHmmssffff
# yyyy  4-digit year
# MM    2-digit month
# dd    2-digit day
# T     letter T as a [common] time separator [if needed]
# HH    2-digit hour
# mm    2-digit minute
# ss    2-digit second
# ffff  4-digit millisecond (f, ff, fff for 1/10, 1/100, and millisecond respectively, etc.)
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Request to add a variable with date and time in Total Commander 11

Post by *ghisler(Author) »

I have chosen a different approach: In beta 3, have added a new pseudo environment variable %$DATE% which inserts the current date in the form YYYYMMDDhhmmss. It also supports the same placeholders as the multi-rename tool, e.g.
%$DATE:YMDhms% and also the 12 hour format variations H and i, and 2 digit years y.
In addition to that, it allows any separators like dots or dashes. In the parameters field you can use e.g.
?%|$DATE:Y-M-D h.m.s|
It also supports partial strings like other environment variables with the ~ syntax.
Author of Total Commander
https://www.ghisler.com
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Request to add a variable with date and time in Total Commander 11

Post by *beb »

2ghisler(Author) that's entirely meets expectations. Thank you very much!
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
hi5
Power Member
Power Member
Posts: 551
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: Request to add a variable with date and time in Total Commander 11

Post by *hi5 »

Thanks!
F4MiniMenu (Forum) - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey). TCSyncComments (copy file comments)
User avatar
funkymonk
Senior Member
Senior Member
Posts: 416
Joined: 2013-12-04, 09:56 UTC

Re: Request to add a variable with date and time in Total Commander 11

Post by *funkymonk »

Looks good in TC11.00b3.

It would look even better if %$DATE% could be used in the pack files dialog to add the current date to the zip filename... (suggestion)
Post Reply