Jump to content

GUICtrlCreateDate return the value in the form (yy/mm/dd) how can I change it to form (dd/mm/yy)?


Recommended Posts

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...