Grantson Posted August 8, 2007 Posted August 8, 2007 Im trying to write a script that will create a folder where the name of the folder is dd-MM-yy I have created a gui with a date picker and created a function that formats the date correctly my question is even though the date picker is called $dateBox and the formatting is applied to $date when i click the run button the date in the date picker changes from long format like 8th August 2007 to 08-08-07 i want to keep displaying long format in the date picker ($dateBox) & have the formatting only applied to $date (i think that makes sence) Can anyone help me here ?
Valuater Posted August 8, 2007 Posted August 8, 2007 need to see your code before we can help you, guessing is not what we do here 8)
Grantson Posted August 8, 2007 Author Posted August 8, 2007 Its a bit scratchy at the moment but there you go CODE#include <GUIConstants.au3> GUICreate("Test GUI") $datebox=GUICtrlCreateDate ("", 10,40,185,20 ) $Button_1 = GUICtrlCreateButton ("Copy", 10, 70, 100) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 $date=Format_date($datebox) MsgBox(0,"Time", GUICtrlRead($date)) EndSelect Wend Func Format_date ($date) ; to select a specific default format $DTM_SETFORMAT = 0x1032 $style = "dd-MM-yy" GuiCtrlSendMsg($date, $DTM_SETFORMAT, 0, $style) MsgBox(0,"Time", GUICtrlRead($date)) Return $date EndFunc
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