Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Is NT 2000 Dos Batch Timestamp sysntax different ?

Re: Is NT 2000 Dos Batch Timestamp sysntax different ?

From: Joe Caporina <spam_at_nospam.com>
Date: Wed, 9 Oct 2002 15:22:52 -0700
Message-ID: <3da48f41$1_5@news.newsgroups.com>


Phil,
I can't even guess what HTH is. I only need the date and time variables. Those variables that the user wants to have in his environment are found before the first "=" sign at the start of this file. SETDATE.COM reads this documentation file to determine which of the variables is required unless one parameter is used, see SETDATE.TXT. Can I modify the SETDATE.TXT to be Windows 2000 compatible. -Joe
"Phil Robyn" <zipprobyn_at_uclink.berkeley.edu> wrote in message news:3DA46C45.4000908_at_uclink.berkeley.edu...
> Joe Caporina wrote:
> > Migrated from NT4 to NT2000 and the batch for setdate/time varables are
not
> > comaptible with NT2000 DOS , Does anyone know where to get an updated
> > setdate shareware or there any work arounds if not available.
> >
> <<<<<<<<<<<<snip>>>>>>>>>
> >
> > contents of setenv.bat; Uses setdate.com shareware
> >
> > SET TODAY=021009
> > SET YR=02
> > SET MTH=10
> > SET HTH=22
> > SET DAY=09
> > SET HR=07
> > SET MIN=48
> > SET SEC=38
> > SET CENT=20
> > SET DOW=We
> > SET DL=Wednesday
> > SET DFS=282
> >
>
> C:\cmd>demo\setdate
>
> set TODAY=021009
> set YR=02
> set MTH=10
> set HTH=???
> set DAY=09
> set HR=10
> set MIN=44
> set SEC=42
> set CENT=20
> set DOW=We
> set DL=Wednesday
> set DFS=282
>
> C:\cmd>rlist demo\setdate.cmd
> =====begin C:\cmd\demo\setdate.cmd====================
> 01. @echo off
> 02. for /f "tokens=1,2" %%a in (
> 03. 'date /t') do set DOW=%%a&set TODAY=%%b
> 04. set DOW=%DOW:~0,2%
> 05. for %%a in (
> 06. Su.Sunday Mo.Monday Tu.Tuesday We.Wednesday
> 07. Th.Thursday Fr.Friday Sa.Saturday
> 08. ) do if "%%~na"=="%DOW%" set DL=%%~xa
> 09. set DL=%DL:~1%
> 10. set TODAY=%TODAY:/=%
> 11. set CENT=%TODAY:~4,2%
> 12. set TODAY=%TODAY:~6,2%%TODAY:~0,4%
> 13. set YR=%TODAY:~0,2%
> 14. set MTH=%TODAY:~2,2%
> 15. set HTH=???
> 16. set DAY=%TODAY:~4,2%
> 17. for /f "tokens=5-7 delims=.: " %%a in (
> 18. 'echo.^|time^|find "urrent"'
> 19. ) do set HR=%%a&set MIN=%%b&set SEC=%%c
> 20. call juliandate %MTH%/%DAY%/%YR%
> 21. set DFS=%juliandate:~3%
> 22. type nul > c:\temp\setenv.bat
> 23. for %%a in (
> 24. TODAY YR MTH HTH DAY HR MIN SEC CENT DOW DL DFS
> 25. ) do (
> 26. set zvar=%%a
> 27. call call echo>>c:\temp\setenv.bat set !zvar!=%%!zvar!%%
> 28. )
> 29. echo/
> 30. type c:\temp\setenv.bat
> 31. goto :EOF
> =====end C:\cmd\demo\setdate.cmd====================
>
> ===== begin file c:\cmd\TEST\juliandate.cmd =====
> 01. @echo off
> 02. ::
> 03. :: converts date in format mm/dd/yy to yy.ddd
> 04. ::
> 05. :: you may enter 'today' as the date
> 06. ::
> 07. if [%1] NEQ [] if [%1] NEQ [?] if [%1] NEQ [/?] goto :begin
> 08. call XHELP %~f0
> 09. goto :EOF
> 10.
> 11. :begin
> 12. setlocal
> 13. set date1=%1
> 14. if /i "%date1%" EQU "TODAY" call :today
> 15. :: for the range of years 1980 - 2079
> 16. set leapyears= 1 80 84 88 92 96 00 04 08 12 16 20 24 28 32
> 17. set leapyears=%leapyears% 36 40 44 48 52 56 60 64 68 72 76
> 18. set leapyr=0
> 19.
> 20. for /f "tokens=1-3 delims=/ " %%a in (
> 21. "%date1%") do set mm=1%%a&set dd=1%%b&set yy=%%c
> 22.
> 23. for /f %%a in (
> 24. 'echo %leapyears% ^| findstr "%yy%"'
> 25. ) do set leapyr=%%a
> 26. set /a mm-=100
> 27. set /a dd-=100
> 28. for /f "tokens=%mm%" %%a in (
> 29. "0 31 59 90 120 151 181 212 243 273 304 334"
> 30. ) do set numdays=%%a
> 31. set /a totaldays= dd + numdays + leapyr
> 32. set /a totaldays+=1000
> 33. set totaldays=%totaldays:~1%
> 34. if [%2]==[.] echo The Julian date for %date1% is %yy%.%totaldays%
> 35. endlocal&set %~n0=%yy%.%totaldays%&goto :EOF
> 36. :today
> 37. for /f "tokens=2" %%a in ( 'date /t' ) do set date1=%%a
> 38. set date1=%date1:~0,6%%date1:~8,2%
> 39. goto :EOF
> ===== end file c:\cmd\TEST\juliandate.cmd =====
>
> What does 'HTH' represent?
>
> --
> t o s e n d e - m a i l u s e ' R e p l y - T o '
> o r u n z i p m y ' F r o m ' a d d r e s s ....
>

-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------

   http://www.newsfeed.com The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =----- Received on Wed Oct 09 2002 - 17:22:52 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US