Kevin,

As requested, and showing another way to get the date.
If you don't want the seconds for the time you could use time /t.

Regards,
Bruce

C:\batch> test_time.bat
[08504789]
[0604Mon]

-------------------------------------------

@echo off
rem test_time.bat

call :get_timestamp

call :get_datestamp

goto :EOF

:::::::::::::::::::::::::::::::::::::::::::::::::::::::


:get_timestamp

        :: get the time in format hhmmssxx, where 'xx' is hundredths of a
second
        ::      because want ssxx can not use time/t
   for /f "tokens=1-8 delims=:. " %%a in ('echo.^| time ^| find "current"')
do (
       set zhh=%%e
       set zmm=%%f
       set zss=%%g
       set zxx=%%h
   )

   if 10 GTR %zhh% set zhh=0%zhh%

        :: assign the values to ztimefull
   set ztimefull=%zhh%%zmm%%zss%%zxx%
 
   echo [%ztimefull%]

        rem cleanup
   set zhh=
   set zmm=
   set zss=
   set zxx=

   goto :EOF

:::::::::::::::::::::::::::::::::::::::::::::::::::::::


:get_datestamp

        :: get the time in format yyyymmdd
   for /f "tokens=1-8 delims=:.-/ " %%a in ('echo.^| date ^| find
"current"') do (
       set zyyyy=%%h
       set zmm=%%g
       set zdd=%%f
   )


        :: assign the values to zdatefull
   set zdatefull=%zyyyy%%zmm%%zdd%
 
   echo [%zdatefull%]

        rem cleanup
   set zyyyy=
   set zmm=
   set zdd=

   goto :EOF

:::::::::::::::::::::::::::::::::::::::::::::::::::::::

-----Original Message-----
Sent: Wednesday, 27 June 2001 7:33 
To: Multiple recipients of list ORACLE-L


Hi all,
        Was wondering if anyone of the brains out there would know how to
add the
hour and minute to this beautiful little script that Tom Mercadante provided
me with?  Not that Tom couldn't do it himself, he just didn't, I didn't ask
for it the first time that I requested such a script.
        Thanks again Tom, this will help me out beautifully:)

rem ************************************************
rem echo off
IF NOT '%1'=='' GOTO SetEnvVars
for /F "delims=/ tokens=1-4" %%i in ('date /t') do today.BAT %%i %%j %%k
%%l
GOTO Done
:SetEnvVars
:: set DayOfWeek=%1
set Month=%2
set Day=%3
set Year=%4
:Done
rem ************************************************


Sincerely,
Kevin Kostyszyn
DBA
Dulcian, Inc
www.dulcian.com
[EMAIL PROTECTED]
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Reardon, Bruce (CALBBAY)
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to