Problems with date command in W2003 Server

June 9, 2009 at 03:42:40
Specs: Windows 2003 Server
I am working with SBS w2k3 Server Spanish version.
I need the day of week to do a msdos script.
if I put 'date /t' shows dd/mm/yyyy format, I don't need this. I need ddd, dd/mm/YYYY format. Can you help me, please??

See More: Problems with date command in W2003 Server

Report •


#1
June 9, 2009 at 03:52:01
control panel > regional > date


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#2
June 9, 2009 at 04:02:41
First, Excuse me for my English, it is very bad.
I know I can choose date format in Control Panel. But only shows dd/mm/yyyy format in ms-dos, I can not change it.
I try to explain me better.
I am doing a ms-dos script. When I put 'date /t' in command line only shows the format I say before, and I want the day of week. I will be crazy finding it.

Report •

#3
June 9, 2009 at 04:34:09
so you want the day of week in alphabets, eg Tue, or Wed right?

Report •

Related Solutions

#4
June 9, 2009 at 04:41:28
Right! I don't mind if it is in English or Spanish, but I need to Know if it is Sun, Mon.. or Friday. And I don't mind if it shows only with 3 caracters o completly.
Do you understand me?


Report •

#5
June 9, 2009 at 04:54:28
better to do it with something else, eg vbscript
WScript.Echo WeekdayName(Weekday(Now),1)


Report •

#6
June 9, 2009 at 04:59:38
ok.

Thanks a lot.


Report •

#7
June 9, 2009 at 07:16:34
SETLOCAL ENABLEEXTENSIONS

FOR /F "tokens=1,2 delims= " %%A in ('ECHO %DATE%') DO (
set FULLDATE=%%B
set DOW=%%A
)

if "%FULLDATE%"=="" (
goto GB
) else (
goto US
)

:US
For /f "tokens=1-7 delims=:/-, " %%i in ('echo exit^|cmd /q /k"prompt $D $T"') do (
For /f "tokens=2-4 delims=/-,() skip=1" %%a in ('echo.^|date') do (
set dow=%%i
set %%a=%%j
set %%b=%%k
set %%c=%%l
set hh=%%m
set min=%%n
set ss=%%o
)
)

goto end

:GB
For /f "tokens=1-6 delims=:/-, " %%i in ('echo exit^|cmd /q /k"prompt $D $T"') do (
For /f "tokens=2-4 delims=/-,() skip=1" %%a in ('echo.^|date') do (
set %%a=%%i
set %%b=%%j
set %%c=%%k
set hh=%%l
set min=%%m
set ss=%%n
)
)


Report •

#8
June 9, 2009 at 23:57:35
thanks David. But I need de day of week, not de number of the day of the month.
The comand date takes de output: dd/mm/yyyy. And I would Know if today is Wensday or Friday, or Saturday.

Don't mind. I ask to my boss.


Report •

#9
June 10, 2009 at 05:46:37
This will get the day of the week from BIOS, regardless of language, region or anything else.

==============================
@echo off > d.d

>> d.d echo E 0100 B4 2A CD 21 B4 4C CD 21
>> d.d echo N getdow.COM
>> d.d echo RCX
>> d.d echo 8
>> d.d echo W
>> d.d echo Q

debug < d.d > nul
del d.d

getdow
if errorlevel 0 set day=Sunday
if errorlevel 1 set day=Monday
if errorlevel 2 set day=Tuesday
if errorlevel 3 set day=Wednesday
if errorlevel 4 set day=Thursday
if errorlevel 5 set day=Friday
if errorlevel 6 set day=Saturday
echo today is %day%
del getdow.com


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#10
June 10, 2009 at 05:53:46
Day of week is available in some locales and not other. You can set your locale through the control panel. Have a look at the variable %dow% that is getting set in the US section.

%dow% day of the week ie Wed
%mm% month
%dd% day of the month
%yy% 4 digit year
%hh% hour
%min% minute
%sec% second



Report •


Ask Question