Datumsausgabe

  • Hi, wie kann es hiermit machen das das Datum so ausgeben wird.
    z.B. 1611 für den 16.11 und nicht 2009/11/16

    [autoit]

    #include <GUIConstantsEx.au3>
    GUICreate("", 220, 240, -1, -1)

    [/autoit][autoit][/autoit][autoit]

    $Date = GUICtrlCreateMonthCal("", 10, 10, 200, 200)

    [/autoit][autoit][/autoit][autoit]

    GUISetState(@SW_SHOW)
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Date
    MsgBox(0, "", GUICtrlRead(-1, $Date))
    EndSwitch
    WEnd

    [/autoit]
    • Offizieller Beitrag

    Hier mal ein Beispiel:

    [autoit]

    #include <Array.au3>
    #include <GUIConstantsEx.au3>
    GUICreate("", 220, 240, -1, -1)

    [/autoit][autoit][/autoit][autoit]

    $Date = GUICtrlCreateMonthCal("", 10, 10, 200, 200)

    [/autoit][autoit][/autoit][autoit]

    GUISetState(@SW_SHOW)
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Date
    $test = StringSplit(GUICtrlRead(-1, $Date),"/")
    MsgBox(0, "Aktuelles Datum: ", $test[3]&"."&$test[2]&"."&$test[1])
    EndSwitch
    WEnd

    [/autoit]


    Einfach die Rückgabe mit StrinSplit aufsplitten.

  • StringFormat ist schöner :P ^^

    [autoit]

    #include <GUIConstantsEx.au3>

    [/autoit][autoit][/autoit][autoit]

    GUICreate("", 220, 240, -1, -1)

    [/autoit][autoit][/autoit][autoit]

    $Date = GUICtrlCreateMonthCal("", 10, 10, 200, 200)

    [/autoit][autoit][/autoit][autoit]

    GUISetState(@SW_SHOW)
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Date
    $split = StringSplit(GUICtrlRead(-1, $Date),"/")
    MsgBox(0,"",StringFormat("%d.%d.%d",$split[3],$split[2],$split[1]))
    EndSwitch
    WEnd

    [/autoit]