Created
March 8, 2023 18:10
-
-
Save Tcip/c432240f6f70b010acc149e1255e8912 to your computer and use it in GitHub Desktop.
Show the time with variable. Hours, minutes, seconds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM Show the time (hours, minutes, seconds) with variable | |
REM https://groups.google.com/g/microsoft.public.win2000.cmdprompt.admin/c/CHS0gwjZQDA/m/L85IIcFcLgkJ | |
REM <nul (set/p z=sec min hours: %time:~6,2% %time:~3,2% %time:~0,2%) | |
title %~nx0 | |
cls | |
cd %~dp0 | |
echo. | |
echo Show the time with variable | |
echo. | |
<nul (set/p z= %time:~0,2%:%time:~3,2%:%time:~6,2%) | |
echo. | |
echo. | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output
I use a 24 hour format. I guess it says
09:17:24 PM
for those of you with 12 hour clock format.Disclaimer
I'm not the author. I just moved the variables.
source: https://groups.google.com/g/microsoft.public.win2000.cmdprompt.admin/c/CHS0gwjZQDA/m/L85IIcFcLgkJ