Jump to content
Sign in to follow this  

Date box

Recommended Posts


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 ?

Share this post

Link to post
Share on other sites

need to see your code before we can help you, guessing is not what we do here



Share this post

Link to post
Share on other sites

Its a bit scratchy at the moment but there you go

#include <GUIConstants.au3>

GUICreate("Test GUI")

$datebox=GUICtrlCreateDate ("", 10,40,185,20 )

$Button_1 = GUICtrlCreateButton ("Copy", 10, 70, 100)


; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()


Case $msg = $GUI_EVENT_CLOSE


Case $msg = $Button_1


MsgBox(0,"Time", GUICtrlRead($date))



Func Format_date ($date)

; to select a specific default format


$style = "dd-MM-yy"

GuiCtrlSendMsg($date, $DTM_SETFORMAT, 0, $style)

MsgBox(0,"Time", GUICtrlRead($date))

Return $date


Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.