Jkeith247 Posted June 8, 2011 Share Posted June 8, 2011 (edited) Hello all, I am curious if there is a way to convert the output of the calendar to the day of the year. I have looked all over the forums and haven't really found what I was looking for. Where $Date = GUICtrlCreateMonthCal(@year & "/" & @mon & "/" & @mday , 10, 10) GuiCtrlSetOnEvent ($Date, "Date") would be my calendar, when I click the day, I am trying to get it to give me the yday instead of the full date. Func Date() MsgBox (4096, "Date", "The Date you have selected is "& GuiCtrlRead ($date)) ;instead of $date being output, I would like it's respective "yday" EndFunc I have found the way to calculate this from the beginning of a year but how do I extract the year from the date selected to do this calculation? Any help would be greatly appreciated I am sure I am missing something really simple... Thanks! Edited June 8, 2011 by Jkeith247 Link to comment Share on other sites More sharing options...
kaotkbliss Posted June 8, 2011 Share Posted June 8, 2011 If you are looking to just do this with the current day, then the macro @YDAY gives the current day of the year. If you are looking to calculate the day of the year from another date, then look at the Date Management section of the User Defined Functions in the help 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
Xenobiologist Posted June 8, 2011 Share Posted June 8, 2011 #include <GUIConstantsEx.au3> #include <Date.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $Date, $msg, $ok_B GUICreate("Get date", 210, 210) $Date = GUICtrlCreateMonthCal(@year & "/" & @mon & "/" & @mday, 10, 10) $ok_B = GuiCtrlCreateButton ('OK', 10, 180, 100) GUISetState() ; Run the GUI until the dialog is closed or timeout Do $msg = GUIGetMsg() If $msg = $ok_B Then MsgBox(0, 'Text', 1 + (_DateDiff('d', StringLeft(GUICtrlRead($Date), 4) & "/01/01 00:00:00", GUICtrlRead($Date))) & @CRLF & 'YDAY is : ' & @YDAY, 2) Until $msg = $GUI_EVENT_CLOSE EndFunc ;==>Example Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Jkeith247 Posted June 8, 2011 Author Share Posted June 8, 2011 Wow Xeno, you hit the nail on the head. Thank you so much! Sometimes you just need to see it, to understand it. AWESOME! Link to comment Share on other sites More sharing options...
Xenobiologist Posted June 8, 2011 Share Posted June 8, 2011 Glad, that I could help! Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times 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