the kick inside Posted January 11, 2011 Share Posted January 11, 2011 (edited) Can some one verify if i am going mad...(build 3.3.6.1) #include <Date.au3> msgbox(1,"",_DateToDayOfWeekISO (@YEAR, @MON, @MDAY)) Run today (Tuesday) produces "2" for me - according to the documentation (and how it always worked for me in the past) it is should produce 1? "Success: Returns Day of the Week Range is 0 to 6 where 0=Monday. " Can someone independantly verify please? Many thanks Edited January 11, 2011 by the kick inside Link to comment Share on other sites More sharing options...
ZacUSNYR Posted January 11, 2011 Share Posted January 11, 2011 Sounds like documention is wrong. ; #FUNCTION# ==================================================================================================================== ; Name...........: _DateToDayOfWeekISO ; Description ...: Returns the ISO weekdaynumber for a given date. ; Syntax.........: _DateToDayOfWeekISO($iYear, $iMonth, $iDay) ; Parameters ....: $iYear - A valid year in format YYYY ; $iMonth - A valid month in format MM ; $iDay - A valid day in format DD ; Return values .: Success - Returns Day of the Week Range is 1 to 7 where 1=Monday. ; Failure - 0 and Set @ERROR to: ; |0 - No error. ; |1 - Invalid Input Date ; Author ........: Jos van der Zande <jdeb at autoitscript dot com> ; Modified.......: ; Remarks .......: ; Related .......: _DateToDayOfWeek, _DateDayOfWeek, _DayValueToDate, _DateAdd, _DateDiff ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Link to comment Share on other sites More sharing options...
iamtheky Posted January 11, 2011 Share Posted January 11, 2011 Tuesday results in 1 as documented, from what i can tell. #include <Date.au3> if @WDAY = 1 Then $day = "sun" Elseif @WDAY = 2 Then $day = "mon" Elseif @WDAY = 3 Then $day = "tue" Elseif @WDAY = 4 Then $day = "wed" Elseif @WDAY = 5 Then $day = "thur" Elseif @WDAY = 6 Then $day = "fri" Elseif @WDAY = 7 Then $day = "sat" EndIf msgbox (0, '' , $day) msgbox(1,"",_DateToDayOfWeekISO (@YEAR, @MON, @MDAY)) ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
kylomas Posted January 11, 2011 Share Posted January 11, 2011 Hi, The doc that I have reads as follows: Return Value Success: Returns Day of the Week Range is 1 to 7 where 1=Sunday. Failure: 0 and Set @error @error: 0 - No error. 1 - Invalid Input Date Therefore Tuesday = 3 IT DOES sound like some conflicting doc (update autoit and scite last month). kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
iamtheky Posted January 11, 2011 Share Posted January 11, 2011 (edited) That would mean there are 3 different sets of verbiage, Unless ZacUSNYR's was not an exact copy, because my date.au3 reflects the same 0 to 6 return values.Success: Returns Day of the Week Range is 0 to 6 where 0=Monday. Failure: 0 and Set @error @error: 0 - No error. 1 - Invalid Input Datev 3.3.4.0 Edited January 11, 2011 by iamtheky ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 11, 2011 Moderators Share Posted January 11, 2011 Hi all,If you look inside Date.au3 in v3.3.6.1, you find 2 functions:_DateToDayOfWeek where 1 = Sunday to 7 = Saturday - the Help file agrees. _DateToDayOfWeekISO where 1 = Monday to 7 = Sunday - the Help file states 0 to 6, but the function is correct according to ISO 8601. So which of you is going to raise the ticket in Trac so it can be amended? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ZacUSNYR Posted January 11, 2011 Share Posted January 11, 2011 That would mean there are 3 different sets of verbiage, Unless ZacUSNYR's was not an exact copy, because my date.au3 reflects the same 0 to 6 return values.v 3.3.4.0Posted above is directly out of date.au3 from my 3.3.6.1 install. Link to comment Share on other sites More sharing options...
iamtheky Posted January 11, 2011 Share Posted January 11, 2011 I thought not, just didnt want to start rumors based off assumptions (when i can catch myself). ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Developers Jos Posted January 11, 2011 Developers Share Posted January 11, 2011 Was already corrected in the SVN lib a while ago so will be correct in the next version. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
the kick inside Posted January 12, 2011 Author Share Posted January 12, 2011 Thanks guys - I really thought I was loosing it! I have been workign with quite an old version and had updated and all of a sudden my code went west...... Many thanks for you time Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now