Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: NT 4 batch for time/date is not compatible with NT2000
On Wed, 9 Oct 2002 11:08:43 -0700, "Joe Caporina" <spam_at_nospam.com>
wrote:
>Does anyone know where to get an updated
>setdate shareware or there any work arounds if not available.
I am not sure I understand your problem correctly, but it seems your SETDATE.COM utility does not work properly. Here is a VBScript that will emulate the apparent behavior and produce output like you describe. I gave guessed what the variables are supposed to contain, but I am unable to see what "HTH" should be, so I have commented that line out. You must run the script using cscript.exe like this:
cscript setdate.vbs>setenv.bat
Here is the script:
d = Now
wscript.echo "SET TODAY=" & Right(DatePart("YYYY", d),2) & _
Patch(DatePart("m", d), 2) & Patch(DatePart("d", d), 2)
wscript.echo "SET YR=" & Right(DatePart("YYYY", d),2)
wscript.echo "SET MTH=" & Patch(DatePart("m", d), 2)
'wscript.echo "SET HTH=" & "??"
wscript.echo "SET DAY=" & Patch(DatePart("d", d), 2) wscript.echo "SET HR=" & Patch(DatePart("h", d), 2) wscript.echo "SET MIN=" & Patch(DatePart("n", d), 2) wscript.echo "SET SEC=" & Patch(DatePart("s", d), 2) wscript.echo "SET CENT=" & Left(DatePart("YYYY",d ), 2) wscript.echo "SET DOW=" & WeekDayName(DatePart("w", d), True) wscript.echo "SET DL=" & WeekDayName(DatePart("w", d), False) wscript.echo "SET DFS=" & DatePart("y", d)
Private Function Patch(sInput, Length) ' as string If Len(sInput) >= Length Then
Patch = sInput
Else
Patch = String(Length - Len(sInput), "0") & sInput
End If
End Function
-- Helge Wunderlich Please remove obvious part of address to send mailReceived on Sat Oct 12 2002 - 14:22:47 CDT
![]() |
![]() |