DayOfWeek

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
HolyAbsolut
Newbie
Posts: 17
Joined: Wed Sep 21, 2011 10:28 am

DayOfWeek

Post by HolyAbsolut » Tue Feb 26, 2013 11:44 am

Hi @ all,

I'm looking for a possibility to check the Day (Monday,Tuesday,.....) for a Date which I can enter. So not like the the actual DayOfWeek who only provides Day from Today.

Who can help ?

Thanks for your effort.

Best Regards

HolyAbsolut

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Feb 26, 2013 1:02 pm

Do you mean you want to find the day from any given date? Like this?

GetDate>thedate
VBEval>WeekDay(%thedate%,2),DayOfWeek

2 means start on Monday so a result of 1 means Monday .. 7 Sunday.

Substitute thedate for any date. Use DateLocal if you need to convert a string date to a local date stamp.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

olllllliii
Pro Scripter
Posts: 60
Joined: Tue Dec 22, 2009 9:51 am
Location: Mannheim ( Germany )
Contact:

Post by olllllliii » Tue Feb 26, 2013 2:49 pm

Hi Marcus,

i am working on a ( German windows 7 ultimate 64 bit )

compiler error 1006 ')' expected...

Code: Select all

GetDate>thedate
VBEval>WeekDay(%thedate%,2),DayOfWeek
do u know what error 1006 mean ?
Oliver Hilger Mannheim
alias Olllllliii

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Feb 26, 2013 4:26 pm

Maybe your local date format is the problem. But I didn't think you wanted to use the current date. I thought you wanted to use some other entered date.

Well if you want to use the current date try:

VBEval>WeekDay(date(),2),DayOfWeek
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Wed Feb 27, 2013 1:04 am

Are you wanting to check the what day a future or past day is?

For Example
Question: I want to know what day it is on the 24 May 2013?
Answer: Friday
FIREFIGHTER

olllllliii
Pro Scripter
Posts: 60
Joined: Tue Dec 22, 2009 9:51 am
Location: Mannheim ( Germany )
Contact:

Post by olllllliii » Wed Feb 27, 2013 7:40 am

CyberCitizen wrote:Are you wanting to check the what day a future or past day is?

yes , marcus solved it ! 0=Sunday 1=Monday 2=Thuesday and so on .....

For Example
Question: I want to know what day it is on the 24 May 2013?
Answer: Friday
yes its done ...thank you ...
Oliver Hilger Mannheim
alias Olllllliii

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts