Kleiner Konverter für Unix und Windows Timestamp

  • Hallo zusammen,

    auf Basis vom ursprünglichen Thread habe ich mich daran gemacht, eine ähnliche Anwendung zu stricken. Bei mir soll das jedoch nicht mit phpmyadmin, sondern mit SQuirreL SQL Client gehen.

    Die Anwendung startet als Systemtrayanwendung. Mit der Tastenkombination Alt + W wird ein Unixtimestamp als Windowszeit angezeigt, mit der Tastenkombination Alt + U wird aus einem Windows Datum ein Unixtimestamp.

    Folgende kleine Probleme habe ich noch:
    1.) Wenn ich einmal Alt + U gedrückt habe und dann mit X die GUI wieder schließe, kann ich die Tastenkombination Alt + W oder Alt + U nicht mehr aktivieren, obwohl die Anwendung noch im Systemtray läuft
    2.) Wenn ich mit Alt + Shift + U den Unixtimestamp ausrechnen will, dann bekomme ich das beim ersten mal sauber hin. Wenn ich jedoch ein zweites unterschiedliches Datum auswähle, sehe ich beim drücken der Schaltfläche, das sich das Windowsdatum und der Unixtimestamp ändert, jedoch nach ca. 1 Sekunden wenn ich mit der Maus über das Inputfeld fahre, springt der Unixtimestamp wieder auf die Zeit der ersten Abfrage zurück. Da ich den Code nochmals neu strukturiert habe, kann ich sagen, das dieser Fehler irgendwo in der Func _win2unix() stecken muss (davon gehe ich mal aus)

    Anbei noch der Code (ACHTUNG - Code wurde seit Veröffentlichung komplett ausgetauscht):

    Spoiler anzeigen
    [autoit]

    #include <Constants.au3>
    #include <GUIConstantsEx.au3>
    #include <Misc.au3>
    #include <UnixTimeMod.au3>

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

    HotKeySet ("^!w","_unix2win")
    HotKeySet ("^!u","_win2unix")

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

    ;Tray-Menü anpassen
    Opt("TrayOnEventMode", 1)
    Opt("TrayMenuMode", 1)

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

    Global $MyDateGUI, $GesetzteWindowsZeit, $date, $UnixButton, $MyUnixTime, $ErrechneteUnixZeitLabel, $ErrechneteUnixZeitInput, $aboutitem, $exititem, $text, $result

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

    $aboutitem = TrayCreateItem("Über")
    TrayItemSetState(-1, $TRAY_UNCHECKED)
    TrayItemSetOnEvent(-1, "Ueber")
    TrayCreateItem("")
    $exititem = TrayCreateItem("Beenden")
    TrayItemSetState(-1, $TRAY_UNCHECKED)
    TrayItemSetOnEvent(-1, "ExitEvent")
    TraySetState()

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

    ;DLL öffnen und Handle übergeben
    $dll_handle = DllOpen("user32.dll")

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

    ;;;; Hier ist der Hauptteil des Programms ;;;;
    While 1
    Sleep(100)
    WEnd

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

    ; Funktionen

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

    Func _unix2win()
    ConsoleWrite("Funktion UNIX2WIN wurde aufgerufen" & @CRLF)
    Sleep(250); Kurz warten
    Send("^c"); Drücke Ctrl + C
    $text = ClipGet(); Lese die Zwischenablage in die Variable "$text"
    ClipPut(""); Lösche die Zwischenablage
    $result = StringLeft($text, 13); Lese 13 Zeichen von Links
    $text = StringReplace($result, ".", ""); Entferne die Punkte aus dem Resultat

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

    ;Lesbares Datum erzeugen
    If StringLen($text) = 10 And $text <= 2145913199 Then ; Ursprünglich 1645484400, warum auch immer
    $format = "%a, %d.%m.%Y - %H:%M:%S Uhr"
    $datum = _StringFormatTime($format, $text)
    $datum = StringReplace($datum, "Mon", "Montag")
    $datum = StringReplace($datum, "Tue", "Dienstag")
    $datum = StringReplace($datum, "Wed", "Mittwoch")
    $datum = StringReplace($datum, "Thu", "Donnerstag")
    $datum = StringReplace($datum, "Fri", "Freitag")
    $datum = StringReplace($datum, "Sat", "Samstag")
    $datum = StringReplace($datum, "Sun", "Sonntag")
    Else
    $datum = "Kein Timestamp Format erkannt!"
    EndIf

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

    ;Ergebnis bis zur nächsten relevanten Mausbewegung (10px) oder Mausklick anzeigen
    ToolTip($datum)

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

    $init_pos = MouseGetPos()
    $init_pos_x = $init_pos[0]
    $init_pos_y = $init_pos[1]

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

    While 1
    $current_pos = MouseGetPos()
    $current_pos_x = $current_pos[0]
    $current_pos_y = $current_pos[1]

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

    If (($init_pos_x - $current_pos_x) * - 1 >= 10 Or ($init_pos_y - $current_pos_y) * - 1 >= 10) Or _IsPressed(01, $dll_handle) Then
    ToolTip("")
    ExitLoop
    Sleep(50)
    EndIf
    WEnd
    EndFunc

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

    Func _win2unix()
    ConsoleWrite("Funktion WIN2UNIX wurde aufgerufen" & @CRLF)
    Local $DTM_SETFORMAT_, $style
    $MyDateGUI = GUICreate("UnixZeit", 200, 200, (@DesktopWidth / 2) - 100, 200); GUI erzeugen
    $date = GUICtrlCreateDate(-1, 10, 10, 185, 20); Datumsauswahl Control erzeugen
    ConsoleWrite(GUICtrlRead($date) & " nach der ersten Deklaration" & @CRLF)
    $DTM_SETFORMAT_ = 0x1032 ; $DTM_SETFORMATW
    $style = "yyyy/MM/dd HH:mm:ss"
    $Label01 = GUICtrlCreateLabel("Bitte Umrechnungsdatum auswählen:", 10, 50, 200, 20); Label erzeugen
    $UnixButton = GUICtrlCreateButton("Unixzeit ausrechnen", 50, 80, 110, 20); Schaltfläche erzeugen
    GUISetState(@SW_SHOW)
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE ; Wenn X gedrückt wird, wird GUI geschlossen, die Anwendung läuft aber weiter.
    GUIDelete($MyDateGUI)
    Case $UnixButton; Wenn Schaltfläche gedrückt wird, wird das Windows Zeitformat ins UnixZeitFormat umgerechnet
    GUICtrlSendMsg($date, $DTM_SETFORMAT_, 0, $style);"Formatiere Datum"
    ConsoleWrite(GUICtrlRead($date) & " nach der GUICtrlSendMsg" & @CRLF)
    $GesetzteWindowsZeit = GUICtrlCreateLabel("Windowszeit: " & GUICtrlRead($date), 10, 120, 200, 20); Zeige zur Kontrolle das gewählte Windows Datum
    ConsoleWrite(GUICtrlRead($date) & " nach der Windowszeit" & @CRLF)
    $MyUnixTime = _Epoch_encrypt(GUICtrlRead($date)); Convertiere dieses ins UnixZeitFormat
    ConsoleWrite(GUICtrlRead($date) & " nach Epoch_encrypt" & @CRLF)
    $ErrechneteUnixZeitLabel = GUICtrlCreateLabel("Unixzeit (UTC / GMT): ", 10, 160, 150, 20);Erzeuge Label
    $ErrechneteUnixZeitInput = GUICtrlCreateInput("", 120, 160, 75, 18); Erzeuge Inputfeld, damit der Zeitstempel später kopiert werden kann.
    GUICtrlSetData($ErrechneteUnixZeitInput, $MyUnixTime)
    ConsoleWrite($MyUnixTime & " $MyUnixTime" & @CRLF)
    GUISetState(@SW_SHOW); Aktualisiere die GUI
    $MyUnixTime = ""
    EndSwitch
    WEnd
    EndFunc

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

    Func ExitEvent()
    Exit
    EndFunc ;==>ExitEvent

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

    Func Ueber()
    MsgBox(64, "Information", "Mit dieser Anwendung kann man Zeitstempel vom Unix Format ins Windows Format und umgekehrt convertieren" & @CRLF & @CRLF & "von Unix nach Windows:" & @CRLF & "1. Markieren Sie die Unixzeit" & @CRLF & '2. Drücken Sie die Tasten "ALT" und "STRG" und "w"' & @CRLF & "3. Die Zeit wird als Tooltip angezeigt" & @CRLF & @CRLF & "von Windows nach Unix:" & @CRLF & '1. Drücken Sie die Tasten "ALT" und "STRG" "u"' & @CRLF & "2. Wählen Sie ein Datum aus" & @CRLF & '3. Drücken Sie die Schaltfläche"Unixzeit ausrechnen"')
    EndFunc ;==>Ueber

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

    Func _EPOCH_decrypt($epoch_time)

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

    Local $Day2Add = Int($epoch_time / 86400)
    Local $iTimeVal = Mod($epoch_time, 86400)

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

    If $iTimeVal < 0 Then
    $Day2Add -= 1
    $iTimeVal += 86400
    EndIf

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

    Local $i_wFactor = Int((573371.75 + $Day2Add) / 36524.25)
    Local $i_xFactor = Int($i_wFactor / 4)
    Local $i_bFactor = 2442113 + $Day2Add + $i_wFactor - $i_xFactor

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

    Local $i_cFactor = Int(($i_bFactor - 122.1) / 365.25)
    Local $i_dFactor = Int(365.25 * $i_cFactor)
    Local $i_eFactor = Int(($i_bFactor - $i_dFactor) / 30.6001)

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

    Local $asDatePart[3]
    $asDatePart[2] = $i_bFactor - $i_dFactor - Int(30.6001 * $i_eFactor)
    $asDatePart[1] = $i_eFactor - 1 - 12 * ($i_eFactor - 2 >= 13)
    $asDatePart[0] = $i_cFactor - 4716 + ($asDatePart[1] < 3)

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

    Local $asTimePart[3]
    $asTimePart[0] = Int($iTimeVal / 3600)
    $iTimeVal = Mod($iTimeVal, 3600)
    $asTimePart[1] = Int($iTimeVal / 60)
    $asTimePart[2] = Mod($iTimeVal, 60)

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

    Return SetError(0, 0, StringFormat("%.2d/%.2d/%.2d %.2d:%.2d:%.2d", $asDatePart[0], $asDatePart[1], $asDatePart[2], $asTimePart[0], $asTimePart[1], $asTimePart[2]))

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

    EndFunc ;==>_EPOCH_decrypt

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

    Func _Epoch_encrypt($date)

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

    Local $main_split = StringSplit($date, " ")
    If $main_split[0] - 2 Then
    Return SetError(1, 0, "") ; invalid time format
    EndIf

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

    Local $asDatePart = StringSplit($main_split[1], "/")
    Local $asTimePart = StringSplit($main_split[2], ":")

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

    If $asDatePart[0] - 3 Or $asTimePart[0] - 3 Then
    Return SetError(1, 0, "") ; invalid time format
    EndIf

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

    If $asDatePart[2] < 3 Then
    $asDatePart[2] += 12
    $asDatePart[1] -= 1
    EndIf

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

    Local $i_aFactor = Int($asDatePart[1] / 100)
    Local $i_bFactor = Int($i_aFactor / 4)
    Local $i_cFactor = 2 - $i_aFactor + $i_bFactor
    Local $i_eFactor = Int(1461 * ($asDatePart[1] + 4716) / 4)
    Local $i_fFactor = Int(153 * ($asDatePart[2] + 1) / 5)
    Local $aDaysDiff = $i_cFactor + $asDatePart[3] + $i_eFactor + $i_fFactor - 2442112

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

    Local $iTimeDiff = $asTimePart[1] * 3600 + $asTimePart[2] * 60 + $asTimePart[3]

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

    Return SetError(0, 0, $aDaysDiff * 86400 + $iTimeDiff)

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

    EndFunc ;==>_Epoch_encrypt

    [/autoit]


    Danke für Eure Hilfe

    2 Mal editiert, zuletzt von HassanMullah (15. April 2013 um 15:18) aus folgendem Grund: Code geändert

    • Offizieller Beitrag

    Wo ist die benötigte UDF?

  • hab mir das nur grob angeschaut, aber sollte die Umrechnung nicht auch so gehen :

    Spoiler anzeigen
    [autoit]

    #include <Date.au3>

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

    Global $sDate = @YEAR&"/"&@MON&"/"&@MDAY&" "&@HOUR&":"&@MIN&":"&@SEC
    Global $iUnixtime = _win2unix($sDate)
    MsgBox(0,"Unixtime $sDate",$iUnixtime)

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

    Func _win2unix ($sDate)
    Local $iUnix = _DateDiff("s","1970/01/01 00:00:00",$sDate)
    Return SetError(@error,@extended,$iUnix)
    EndFunc
    Func _unix2win ($iUnix)
    Local $sDate = _DateAdd("s",$iUnix,"1970/01/01 00:00:00")
    Return SetError(@error,@extended,$sDate)
    EndFunc

    [/autoit]


    Da das Formt von Date-Controls anders ist, muss man nur noch _GUICtrlDTP_SetFormat verwenden und einen kleinen RegExp , um die Ausgabe wieder umzustellen

  • Ups habe ich vergessen.
    Hier die "UnixTimeMod.au3"

    Spoiler anzeigen
    [autoit]

    #include-once

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

    ;======================================================================================================================
    ; !!!!!!!!!!!!!!!!! ACHTUNG !!!!!!!!!!!!!!!!!!!!!!!!!!!
    ;======================================================================================================================
    ;
    ; In dieser Version wurde an Stelle der "CrtDll.dll" die "msvcrt.dll" verwendet, da diese auf 32Bit- und 64Bit-Systemen
    ; und auf beiden AutoIT-Versionen läuft - sonst wird ggf. immer FALSE zurück gegeben.
    ;
    ; Siehe: http://www.autoitscript.com/forum/topic/12…__gopid__874595
    ;======================================================================================================================

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

    ;===============================================================================
    ;
    ; AutoIt Version: 3.2.3.0
    ; Language: English
    ; Description: Dll wrapper functions for dealing with Unix timestamps.
    ; Requirement(s): CrtDll.dll
    ; Notes: If CrtDll.dll is not available then functions will return false
    ; and set @error = 99.

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

    ;===============================================================================
    ;
    ; Description: _TimeGetStamp - Get current time as Unix timestamp value.
    ; Parameter(s): None
    ; Return Value(s): On Success - Returns Unix timestamp
    ; On Failure - Returns False, sets @error = 99
    ; Author(s): Rob Saunders ([email='admin@therks.com'][/email])
    ; User Calltip: _TimeGetStamp() - Get current time as Unix timestamp value. (required: <_UnixTime.au3>)
    ;
    ;===============================================================================

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

    Func _TimeGetStamp()
    Local $av_Time
    $av_Time = DllCall('msvcrt.dll', 'long:cdecl', 'time', 'ptr', 0)
    If @error Then
    SetError(99)
    Return False
    EndIf
    Return $av_Time[0]
    EndFunc

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

    ;===============================================================================
    ;
    ; Description: _TimeMakeStamp - Create Unix timestamp from input values.
    ; Syntax: _TimeMakeStamp( [ second [, minute [, hour [, day [, month [, year [, isDST ]]]]]]] )
    ; Parameter(s): Second - Second for timestamp (0 - 59)
    ; Minute - Minute for timestamp (0 - 59)
    ; Hour - Hour for timestamp (0 - 23)
    ; Day - Day for timestamp (1 - 31)
    ; Month - Month for timestamp (1 - 12)
    ; Year - Year for timestamp (1970 - 2038)
    ; * All the above values default to the 'Default' keyword, where the current
    ; time/date value will be used.
    ; IsDST - Set to 1 during Daylight Saving Time (DST)
    ; - Set to 0 not during DST
    ; - Set to -1 if unknown, function will try to figure it out
    ; - Default is -1
    ; Return Value(s): On Success - Returns Unix timestamp
    ; On Failure - Parameter error, returns -1
    ; - Dll error, returns False, sets @error = 99
    ; Notes: The function will try and calculate dates for numbers outside of the
    ; usual range.
    ; For example: _TimeMakeStamp(0, 0, 0, 32, 1, 1995)
    ; 32nd day of January? Obviously that's not a valid date, but the function
    ; automatically calculates this to be February 1st. A date of 0 will return
    ; the last day of the previous month.
    ; User CallTip: _TimeMakeStamp($i_Sec = Default, $i_Min = Default, $i_Hour = Default, $i_Day = Default, $i_Mon = Default, $i_Year = Default, $i_IsDST = -1) - Create a UNIX timestamp from input values. (required: <_UnixTime.au3>)
    ; Author(s): Rob Saunders ([email='admin@therks.com'][/email])
    ;
    ;===============================================================================
    Func _TimeMakeStamp($i_Sec = Default, $i_Min = Default, $i_Hour = Default, $i_Day = Default, $i_Mon = Default, $i_Year = Default, $i_IsDST = -1)
    Local $struct_Time, $ptr_Time, $av_Time
    $struct_Time = DllStructCreate('uint;uint;uint;uint;uint;uint;uint;uint;uint')

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

    Select
    Case $i_Sec = Default
    $i_Sec = @SEC
    ContinueCase
    Case $i_Min = Default
    $i_Min = @MIN
    ContinueCase
    Case $i_Hour = Default
    $i_Hour = @HOUR
    ContinueCase
    Case $i_Day = Default
    $i_Day = @MDAY
    ContinueCase
    Case $i_IsDST = Default
    $i_IsDST = -1
    EndSelect
    ; The following is done because the mktime function demands
    ; that the month be in 0-11 (Jan = 0) format instead of 1-12.
    Select
    Case $i_Mon = Default
    $i_Mon = (@MON - 1)
    Case $i_Mon <> Default
    $i_Mon -= 1
    EndSelect
    ; The following is done because the mktime function expects the year in format
    ; (full year - 1900), thus 99 = 1999 and 100 = 2005. The function will try
    ; to figure out what year the user is trying to use. Thus if the function recieves
    ; 70, it's untouched, but if the user gives 1970, 1900 is subtracted automatically.
    ; Any year above 99 has 1900 automatically subtracted.
    Select
    Case $i_Year = Default
    $i_Year = (@YEAR - 1900)
    Case $i_Year < 70
    $i_Year += 100
    Case $i_Year > 99
    $i_Year -= 1900
    EndSelect

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

    DllStructSetData($struct_Time, 1, $i_Sec)
    DllStructSetData($struct_Time, 2, $i_Min)
    DllStructSetData($struct_Time, 3, $i_Hour)
    DllStructSetData($struct_Time, 4, $i_Day)
    DllStructSetData($struct_Time, 5, $i_Mon)
    DllStructSetData($struct_Time, 6, $i_Year)
    DllStructSetData($struct_Time, 9, $i_IsDST)

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

    $ptr_Time = DllStructGetPtr($struct_Time)
    $av_Time = DllCall('msvcrt.dll', 'long:cdecl', 'mktime', 'ptr', $ptr_Time)
    If @error Then
    SetError(99)
    Return False
    EndIf

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

    Return $av_Time[0]
    EndFunc

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

    ;===============================================================================
    ;
    ; Description: _StringFormatTime - Get a string representation of a timestamp
    ; according to the format string given to the function.
    ; Syntax: _StringFormatTime( "format" [, timestamp [, max length ]] )
    ; Parameter(s): Format String - A format string to convert the timestamp to.
    ; See notes for some of the values that can be
    ; used in this string.
    ; Timestamp - A timestamp to format, possibly returned from
    ; _TimeMakeStamp. If left empty, default, or less
    ; than 0, the current time is used. (default is -1)
    ; Max Length - Maximum length of the string to be returned.
    ; Default is 255.
    ; Return Value(s): On Success - Returns string formatted timestamp.
    ; On Failure - Returns False, sets @error = 99
    ; Requirement(s): _TimeGetStamp
    ; Notes: The date/time specifiers for the Format String:
    ; %a - Abbreviated weekday name (Fri)
    ; %A - Full weekday name (Friday)
    ; %b - Abbreviated month name (Jul)
    ; %B - Full month name (July)
    ; %c - Date and time representation (MM/DD/YY hh:mm:ss)
    ; %d - Day of the month (01-31)
    ; %H - Hour in 24hr format (00-23)
    ; %I - Hour in 12hr format (01-12)
    ; %j - Day of the year (001-366)
    ; %m - Month number (01-12)
    ; %M - Minute (00-59)
    ; %p - Ante meridiem or Post Meridiem (AM / PM)
    ; %S - Second (00-59)
    ; %U - Week of the year, with Sunday as the first day of the week (00 - 53)
    ; %w - Day of the week as a number (0-6; Sunday = 0)
    ; %W - Week of the year, with Monday as the first day of the week (00 - 53)
    ; %x - Date representation (MM/DD/YY)
    ; %X - Time representation (hh:mm:ss)
    ; %y - 2 digit year (99)
    ; %Y - 4 digit year (1999)
    ; %z, %Z - Either the time-zone name or time zone abbreviation, depending on registry settings; no characters if time zone is unknown
    ; %% - Literal percent character
    ; The # character can be used as a flag to specify extra settings:
    ; %#c - Long date and time representation appropriate for current locale. (ex: "Tuesday, March 14, 1995, 12:41:29")
    ; %#x - Long date representation, appropriate to current locale. (ex: "Tuesday, March 14, 1995")
    ; %#d, %#H, %#I, %#j, %#m, %#M, %#S, %#U, %#w, %#W, %#y, %#Y - Remove leading zeros (if any).
    ;
    ; User CallTip: _StringFormatTime($s_Format, $i_Timestamp = -1, $i_MaxLen = 255) - Get a string representation of a timestamp according to the format string given to the function. (required: <_UnixTime.au3>)
    ; Author(s): Rob Saunders ([email='admin@therks.com'][/email])
    ;
    ;===============================================================================
    Func _StringFormatTime($s_Format, $i_Timestamp = -1, $i_MaxLen = 255)
    Local $struct_Time, $ptr_Time, $av_Time, $av_StrfTime

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

    If $i_Timestamp = default OR $i_Timestamp < 0 Then
    $i_Timestamp = _TimeGetStamp()
    EndIf
    $ptr_Time = DllCall('msvcrt.dll', 'ptr:cdecl', 'localtime', 'long*', $i_Timestamp)
    If @error Then
    SetError(99)
    Return False
    EndIf

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

    $av_StrfTime = DllCall('msvcrt.dll', 'int:cdecl', 'strftime', _
    'str', '', _
    'int', $i_MaxLen, _
    'str', $s_Format, _
    'ptr', $ptr_Time[0])
    Return $av_StrfTime[1]
    EndFunc

    [/autoit]


    Momentan behelfe ich mir, indem ich das Ergebnis auch in die Zwischenablage schreibe. Somit kann ich es gleich weiter verwenden. Ich verstehe nur nicht, war beim klicken mit der Maus ins Inputfeld immer der Wert der ersten Datumabfrage zurück geschrieben wird. Mir ist nicht bewußt, das ich eine "Mausaktion" hier selbst eingebaut habe.