bhodi78 Posted June 12, 2009 Posted June 12, 2009 In this program I would print the number of days of the two choices, but _DAteDiff work with the form (dd/mm/yy) and GUICtrlRead($GUIreturn_date) return in the form (yy/mm/dd). How can I do? #include <IE.au3> #include <Array.au3> #include <Date.au3> #include <GUIConstantsEx.au3> #include <DateTimeConstants.au3> #requireadmin $Form = GUICreate("GUI",450,200) $GUIdeparture_date =GUICtrlCreateDate (_NowCalc(), 260, 10, 185, 20,$DTS_RIGHTALIGN) $GUIreturn_date =GUICtrlCreateDate (_NowCalc(), 260, 40, 185, 20,$DTS_SHORTDATEFORMAT) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg case $GUIreturn_date $departure_date =GUICtrlRead($GUIdeparture_date) $return_date =GUICtrlRead($GUIreturn_date) $number_of_days =_DateDiff( 'd',$departure_date,$return_date) MsgBox(0,"Number of days",$number_of_days) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Thank you very much bye.
oMBRa Posted June 12, 2009 Posted June 12, 2009 add these 2 lines after GuiCtrlCreateDate: GUICtrlSendMsg($GUIdeparture_date, 0x1032, 0, "yyyy/MM/dd") GUICtrlSendMsg($GUIreturn_date, 0x1032, 0, "yyyy/MM/dd")
bhodi78 Posted June 12, 2009 Author Posted June 12, 2009 add these 2 lines after GuiCtrlCreateDate: GUICtrlSendMsg($GUIdeparture_date, 0x1032, 0, "yyyy/MM/dd") GUICtrlSendMsg($GUIreturn_date, 0x1032, 0, "yyyy/MM/dd") Thanks, it works perfectly! bye
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