Jump to content
Sign in to follow this  
Glenjamin

GuiCtrlCreateDate with $DTS_SHORTDATEFORMAT

Recommended Posts

Glenjamin

Hi,

How can I show the DAY as one variable, the MONTH as another varible and YEAR as another variable with GuiCtrlCreateDate with $DTS_SHORTDATEFORMAT.

I need to know due to when they click on a button it will change a URL with the DAY,MONTH & YEAR in as a seperate link.

Thank you

Share this post


Link to post
Share on other sites
UEZ

Try this whereas you have to change it to your needs because of different date settings:

#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>

Global $date, $msg

GUICreate("My GUI get date", 200, 200, 800, 200)
$date = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20, $DTS_SHORTDATEFORMAT)
GUISetState()

; Run the GUI until the dialog is closed
Do
    $msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE

$aDate = StringRegExp(GUICtrlRead($date), "(\d+)", 3)

;date format = 25.04.1953 -> dd.mm.yyyy
$day = $aDate[0]
$month = $aDate[1]
$year = $aDate[2]

MsgBox(0, "Date", "Day: " & $day & @CRLF & _
                                "Month: " & $month & @CRLF & _
                                "Year: " & $year)

GUIDelete()

This is an example for dd.mm.yyyy!

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
Glenjamin

Hi UEZ,

Thank you. It doe's exactly what it say's on the tin.

Cheers

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.