Jump to content

Calculate the Day of the Week


Recommended Posts

Hello to all,

try to make a func that find Day of the Week from a given data.

I must reconstruct week structure from folder archieve that

store some file day by day using this format YYYYMMDD :

20100101
20100102
20100103
20100104
20100105
20100106
20100107
20100108

Find some info about calculation here : http://www.wikihow.com/Calculate-the-Day-of-the-Week

Can anyone have some info, or help me with logic, to obtain

stable FUNC for this task ?

Thank you all for reading,

m.

find _DateToDayOfWeekISO that works well for this,

ignore this post thank you

Edited by myspacee
Link to comment
Share on other sites

Switch @WDAY
        Case 1
            $day = "Sunday"
        Case 2
            $day = "Monday"
        Case 3
            $day = "Tuesday"
        Case 4
            $day = "Wednesday"
        Case 5
            $day = "Thursday"
        Case 6
            $day = "Tomorrow"
        Case 7
            $day = "Saturday"
    EndSwitch

MsgBox(0, "Today", "The Day is: " & $day)

That should do ya.

Link to comment
Share on other sites

Or when using dates:

#include <Date.au3>

; Week day number for a given date
$iWeekday = _DateToDayOfWeek (@YEAR, @MON, @MDAY)
; Should be equal to @Wday
MsgBox(4096, "", "Todays WeekdayNumber is: " & $iWeekDay)
MsgBox(4096, "", "Today is a : " & _DateDayOfWeek($iWeekDay))
Edited by Rkey
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...