How to? Unexpected %DATE% CMD variable format (vs DATE /T format) in CMDebug

Jun 17, 2021
Georgia, USA

Currently evaluating CMDebug v27.01.24 x64 primarily for - surprise - debugging vanilla .CMD and .BAT scripts. Very powerful IDE but already ran into a few issues. Not sure if there's a setting I'm overlooking.

Found a few close matches here in the forum, but nothing that seemed to cover this exact item.

During debugging, (and only debugging) a proven section of script broke. I tracked it down to CMDebug's expansion of %DATE%. For simplicity this can be observed in the Debug -> Evaluate Command (or -> Evaluate Expression) dialog.

In Windows Command Prompt, I get
C:\> echo %DATE%
Thu 06/17/2021

In CMDebug, I get
echo %DATE%

Note CMDebug's output has
- non-zero padded month
- missing day of week

Obviously, there are several alternate methods to get the needed DATE value that would effectively workaround the unanticipated behavior. However using the %DATE% variable is orders of magnitude faster than DATE /T (on the target Intel Core i7 2.5GHz system) which in this case is key as this section of script can fire several times a second. And cleaner than using a FOR /F to parse the elements of the date. More on DATE /T below.

And certainly, while debugging I can swap in alternate code, but that kind of defeats the purpose and introduces maintenance hassles. My interest in CMDebug is toi *not* have debug code sprinkled throughout while debugging.

Using the DATE /T command in Debug -> Evaluate Command, I still have problems
date /t /f1

date /t /f2
Thu 17/06/2021
Note /f1 is as unexpected as %DATE% and /f2 now changes to DD/MM/YYYY instead of MM/DD/YYYY

So this really seems like a CMDebug configuration I need to tweak but I'm not finding much that speaks to this. And most of the online discussions about INI settings for TCC don't seem to apply here.

So any tips for the new user?



Jul 6, 2008
As far as the /f1 and /f2 issue, it appears this is more a documentation problem. If you view the help subject "TCC Date Display Formats" the 2 is for European format, which is dd/mm/yy, although there is that 4 digit year that doesn't quite fit.:oops:

If you go to your windows "date & time" settings for "short date" and change the format for the short date you can achieve the leading zero.
Fri  Jun 18, 2021 v27.01.23 [3120]

v27.01.23_$echo %date

This change also affects how CMDebug displays dates. Based on the choices this will also add a leading zero to the day. Ie. 06/01/2021 vs 6/1/2021. Enjoy
Similar threads
Thread starter Title Forum Replies Date
vefatica @FILESIZE[] ... allocated ... unexpected results Support 0
T WAD Strange Unexpected "features" in the Debugger Support 2
Mike Hall Unexpected "Variable loop" in IF condition Support 10
rps How to? dir /s unexpected results Support 10
R Unexpected 'Cancel Batch Job' prompts Support 13
A How to? PhraseExpress autotext/autocompletion printing unexpected characters Support 4
S Unexpected error report Support 7
D Unexpected behavior Support 8
H TPIPE: /FILTER and /OUTPUT unexpected incompatibility Support 6
M How to? Work around an unexpected and very inconvenient behavior of TCC... Support 26
M Unexpected Results from Doing Numeric Comparisons... Support 17
F unexpected %1 while starting ide Support 6
vefatica @SERVICE, unexpected results Support 6
Emilio III Unexpected file deletion Support 30
S RECYCLE /P - unexpected behavior Support 0
I on error[msg] unexpected behaviour Support 0
mfarah Fixed The DATE command produces the wrong error message. Support 1
T Date format date different from cmd Support 7
Jesse Heines How to? How to display picture creation date with dir command Support 6
Jesse Heines "Taken" date for JPG and PNG files Support 4
Joe Caverly DATE format 4 Support 7
fpefpe touch - date format Support 2
C 7zip with date range .vs. filelist created with dir and daterange Support 0
C How to? Add date/time to custom tpipe based BTM Support 1
vefatica Download center not up to date Support 4
Joe Caverly How to? Date Range in command line for 7zip /= Support 1
N date and cmd compatibility Support 10
rps Functions @year[date] @isowyear[date] help Support 7
S Closing date for V16 suggestions Support 1
JohnQSmith DATE /T Support 13
A How to? Create a date range based upon creation date Support 2
S How to? Command dialogs vs. size/date/etc. exclusion ranges Support 1
M How to? Effectively "combine" date and time ranges... Support 2
CWBillow Make a folder named Date-Time Support 18
vefatica Do UNTIL DATETIME date time Support 6
S Date range question Support 4
Roedy date range documentation error Support 2
Jay Sage Inconsistency in Date Formats Between @DATE and @MAKEDATE Support 3
dcantor More date-related help items for V11 Support 0
dcantor Help text for Date Formats Support 0
dcantor Suggestion for @DATE[] input Support 2
dcantor @DATE help example Support 0
CWBillow Date and Time in names Support 11
L FTYPE in TCC, less quirky than in cmd.exe Support 3
Peter Murschall Single-line Do-CMD is a bit uncooperative. Support 6
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
D Differences between TCC and CMD with COPY /b Support 4
M Oracle batch OPatch.bat.bat not working in TCC but correctly in CMD Support 5
E TCC/CMD difference Support 5
S How to? Deinstalling TC/reinstating execution of bat files by cmd in Win7 Support 31

Similar threads