Using a technique similar to the Universal Date Parser, I have scripted WhatTime.bat to retrieve the current time.

The syntax for using WhatTime.bat is:

call WhatTime Hour Minute Second Hsec

Where:

<b>Hour</b>   is a <a href="/article/jsifaq/jsi-tip-5535-how-can-i-cause-a-called-batch-file-to-return-a-call-directed-environment-variable-.aspx">call directed environment variable</a> that will contain the 2 digit hour, 00-23.
<b>Minute</b> is a <a href="/article/jsifaq/jsi-tip-5535-how-can-i-cause-a-called-batch-file-to-return-a-call-directed-environment-variable-.aspx">call directed environment variable</a> that will contain the 2 digit minute, 00-59.
<b>Second</b> is a <a href="/article/jsifaq/jsi-tip-5535-how-can-i-cause-a-called-batch-file-to-return-a-call-directed-environment-variable-.aspx">call directed environment variable</a> that will contain the 2 digit second, 00-59.
<b>Hsec</b>   is a <a href="/article/jsifaq/jsi-tip-5535-how-can-i-cause-a-called-batch-file-to-return-a-call-directed-environment-variable-.aspx">call directed environment variable</a> that will contain the 2 digit hundredth of a seconds, 00-99.
NOTE: See How can I retrieve the current time in numeric environment variables?

WhatTime.bat contains:

@echo off
if \{%4\}==\{\} @echo Syntax WhatTime Hour Minute Second Hsec&goto :EOF
for /f "tokens=5-8 delims=:. " %%h in ('@echo.^|time') do (
 set /a %1=100%%h%%100 + 100
 set %2=%%i
 set %3=%%j
 set %4=%%k
)
call set %1=%%%1:~1^,2%%