Jkeith247 0 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 Share this post Link to post Share on other sites
kaotkbliss 146 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 010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueekWe're gonna need another Timmy! Share this post Link to post Share on other sites
Xenobiologist 47 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 Share this post Link to post Share on other sites
Jkeith247 0 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! Share this post Link to post Share on other sites
Xenobiologist 47 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 Share this post Link to post Share on other sites