Sign in to follow this  
Followers 0
bhodi78

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

3 posts in this topic

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.

Share this post


Link to post
Share on other sites



add these 2 lines after GuiCtrlCreateDate:

GUICtrlSendMsg($GUIdeparture_date, 0x1032, 0, "yyyy/MM/dd")
GUICtrlSendMsg($GUIreturn_date, 0x1032, 0, "yyyy/MM/dd")

Share this post


Link to post
Share on other sites

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

:D

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  
Followers 0