Computing.Net > Forums > Programming > dos - day of week

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

dos - day of week

Reply to Message Icon

Name: perla0279
Date: October 29, 2009 at 07:40:52 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

I have need to find the day of the week
es. monday tuesday Wednesday etc…

with commandos dos



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: October 29, 2009 at 08:51:24 Pacific
Reply:

Under Windows XP Pro the day of week is part of the output from

  date /T

however if you are running XP home the easiest choice is to use a tiny utility I coded and can send you if you contact me by a private message with your e-mail address.

0

Response Number 2
Name: ace_omega
Date: October 29, 2009 at 09:46:13 Pacific
Reply:

In this command...

Set DOW=%Date:~-14,3%
echo %DOW%

You are copying the characters from the right -14 character. This set the pointer to where you want to start copying. The 3 sets how many characters you want to copy. So the full %Date% looks like....

Wed 10/28/2009

-14,1 = W
-13,1 = e
-12,1 = d
-11,1 =
-10,1 = 1
-9,1 = 0
-8,1 = /
-7,1 = 2
-6,1 = 8
-5,1 = /
-4,1 = 2
-3,1 = 0
-2,1 = 0
-1,1 = 9


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: dos - day of week

Finding day of week in DOS batch www.computing.net/answers/programming/finding-day-of-week-in-dos-batch/3158.html

Day of year to month and day www.computing.net/answers/programming/day-of-year-to-month-and-day/7031.html

Date Routines in Batch Files www.computing.net/answers/programming/date-routines-in-batch-files/15590.html