Change a console's title to the current time and date on a loop. Windows version.
All about this program and project.
What is this?
This is a console tool for the Windows command line environment that sets the current console's title to the current date and time on a continuous loop with various options. This works in cmd or PowerShell.
Why did I write this?
I like to have the time and date visible in some command line environments depending on what I'm doing and this is one way that helps me do so. I'm constantly in a comand line so it's nice to have the date and time close at hand.
I have written several scripts, functions, and applications like this over the years in Windows and Linux, but this is the best I've ever done for Windows so I'm finally releasing it as a stable. version. Great performace and I'm happy with it. so here it is for anyone else if they care to use it.
Download or build.
You can fork this repository and build yourself or you can download it at the current Releases page.
Where and how to use this program.
Where do I use this?
Like any cli tool (or any executable for that matter) this can be used in any available command line program/emulator in Windows like CMD or PowerShell, for example, and should work in most available terminals with only a few quirks (not a bug, I don't think).
For example in Hyper Terminal ʰʸᵖᵉʳᶦᵒ sometimes if you kill the process (ctdt.exe) it won't display again if you restart ctdt unless you restart Hyper itself and it doesn;t happen always. Doesn't seem to do that it anything else; that I know of.
Like any portable program in this can either be placed somewhere in your %PATH%
and if not then when your run it you'll need to provide the direct path of the executable.
> & 'C:\Users\<USERNAME>\Bin\ctdt.exe' /?
Best methods.
Although this is a normal executable command line tool it can be used in various ways, but the best way is to run it in the background of your, console, more than likely from a start up script/config file or from a shortcut (.lnk), but with the various methods and arguments/parameters in the examples provided below.
Get Help.
In CMD or PowerShell. (with /?, /H, or /HELP). You can also find a screenshot below.
C:\Windows\System32> ctdt /?
┌────────────────────────────────────────────────┐
│ Console Title Date Time │
├────────────────────────────────────────────────┤
│ Set a console's title to the current date │
│ and/or time on a continous loop. It's best to │
│ run this in the background. │
├────────────────────────────────────────────────┤
│ ctdt [/H] [/D] [/T] [/M] [/F format] │
│ Examples: │
│ CMD: │
│ start /B ctdt /m │
│ PowerShell: │
│ Start-Process ctdt -NoNewWindow │
│ -ArgumentList '/m' │
├────────────────────────────────────────────────┤
│ /h,/HELP,/? This help screen. │
│ /d,/DATE Display the date only. │
│ /t,/TIME Display the time only. │
│ What is displayed depends on │
│ which switch is passed last. │
│ /m,/MERIDIEM 12 Hour Meridiem time: AM/PM. │
│ Defaults to a 24 hour clock. │
│ /f,/FORMAT The date's format. Defaults to │
│ U.S. format M/D/Y, but all │
│ variations are possible in the │
│ values of MDY,MYD,DMY,DYM,YMD, │
│ and YDM. │
└────────────────────────────────────────────────┘
CMD Examples.
Good old fashion cmd.exe.
Start it in the background with Meridiem time while allowing more input.
C:\Windows\System32> start /B ctdt /m
PowerShell Examples.
The more powerful PowerShell or PWSH.
Start it in the background with Meridiem time while allowing more input.
> Start-Process ctdt -NoNewWindow -ArgumentList '/m'
This information is generated in a GitHub Action immediately after the successful build of this project.
License Excerpt
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
If you like this project and care to donate to my PayPal:
Or Buy Me A Coffee if your prefer: