UnixTimeStamps in Webanwendungen in lesbares Datum umwandeln

  • Hallo zusammen,

    vielleicht weiß jemand wie das folgende "Problem" zu lösen ist...

    Ich möchte einen markierten Text, welcher sich aktuell unter dem Mauszeiger befindet auslesen, durch eine Funktion jagen und das Ergebnis (solange sich die Maus über dem Text befindet) als kleines Fenster am Mauszeiger anzeigen lassen. Ich habe schon einiges mit Send("^c"), ClipGet und so ausprobiert, aber das taugt alles nichts :-). Ich komme überhaupt nicht weiter. Hat jemand vielleicht ein paar Ansätze?

    Hintergrund: ich arbeite viel mit Unix-Timestamps (in phpMyAdmin) und ich würde mir gerne beim Darüberfahren mit der Maus ein lesbares Datum anzeigen lassen, die UDF zum Umrechnen gibt ja schon (http://www.therks.com/autoit/udfs/UnixTime.au3).

    Ggf. könnte man auch auf den Inhalt einer <td> im DOM über das IE-Objekt darauf zugreifen?1?

    Gruß
    trainer

    Einmal editiert, zuletzt von ip_trainer (3. März 2011 um 15:28) aus folgendem Grund: Aussagekräftigere Überschrift und auf "gelöst" gesetzt

  • Wichtig wäre zu wissen in welchen Programm du die Timestamps ansiehst und markierst.
    Eine einfache Lösung ginge evtl. auch mit der MouseSetOnEvent_UDF.au3 (fällt mir jetzt spontan dazu ein^^ )

  • Hi Schnitzel,

    danke für deine Antwort. Wie gesagt - ich benutze phpMyAdmin, das ist eine Weboberfläche zur Datenbank-Administration. D.h. heißt, das Programm ist (in meinem Fall) der IE8. Die Information steht also im Quelltext einer Websteite, in etwa so:

    <td align="right" class=" nowrap">1299020400</td>

    Wo finde ich denn diese UDF - hab über Google keinen download gefunden ...

    Danke
    trainer

  • So, (um meine Scharte mit der Googlesuche wieder auszuwetzen :D), hier nun der soweit fertige Quellcode:

    Für wen es gedacht ist:
    Leute die mit PHPMyAdmin etc. arbeiten und viel mit UnixTimeStamps hantieren müssen - und diese gerne lesbar gemacht hätten.

    Zur Funktionsweise:
    Durch gleichzeitiges Dücken der STRG-Taste und Klicken mit der linken Maustaste wird ein markierter Text in die Zwischenablage kopiert und (falls der Inhalt in UnixTimeStamp ist) dieser als lesbares deutsches Datum als Tooltip ausgegeben, bis die Maus bewegt oder geklickt wird. Das Verhalten ist allerdings in den verschiedenen Browsern etwas unterschiedlich (IE: vorher STRG drücken (und halten, klar), dann langt ein Klick mit der linken Maustaste. Bei GoogleChrome braucht es einen Doppelklick. Beim Firefox langt auch ein Klick, allerdings muss eine vorherige Auswahl erst wieder durch einen Klick ins Leere aufgelöst werden.)

    Was noch verbessert werden könnte:
    Falls jemand weiß wie man prüfen kann, ob sich unter dem Mauszeiger ein markierter Text befindet, dann könnte man sich das mit dem STRG sparen und das Verhalten wäre in allen Browsern und sonstigen Anwendungen geich, wäre irgendwie cooler.

    Trotzdem, mir wird es jetzt schon sehr helfen (und anderen, so hoffe ich).

    Gruß
    trainer

    P.S. Hier noch ein schönes Icon für's Compilieren: http://www.iconarchive.com/show/office-ic…endar-icon.html

    Das eigentliche Progamm:

    Spoiler anzeigen
    [autoit]


    ;++++++++++++++++++++++++++++++++++++++++++++++++++++
    ; Optionen und Includes
    ;++++++++++++++++++++++++++++++++++++++++++++++++++++

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

    #include-once
    #include <UnixTimeMod.au3> ;Die UnixTimeMod.au3 wurde von mir aus Kompatibilitätsgründen modifiziert (siehe dort).
    #include <Misc.au3>

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

    ;Tray-Menü anpassen
    Opt("TrayOnEventMode",1)
    Opt("TrayMenuMode",1)
    $exit = TrayCreateItem("Exit")
    TrayItemSetOnEvent(-1,"ExitEvent")

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

    ;++++++++++++++++++++++++++++++++++++++++++++++++++++
    ;Hauptprogrammteil
    ;++++++++++++++++++++++++++++++++++++++++++++++++++++

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

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

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

    While 1
    ;STRG-Taste und linke Maustaste gedrückt
    If _IsPressed(11, $dll_handle) AND _IsPressed(01, $dll_handle) Then

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

    ;Text aus der Zwischenablage holen
    Sleep(250); Kurz warten, damit die Markierung per STRG-Klick vor dem Kopieren sauber durchgeführt werden kann
    Send("^{INS}")
    $text = ClipGet()

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

    ;Lesbares Datum erzeugen
    If StringLen($text)=10 AND $text <= 1645484400 THEN
    $format = "%a, %d.%m.%Y - %H:%M:%S Uhr"
    $datum = _StringFormatTime($format, $text)
    $datum = StringReplace($datum, "Mon", "Mo")
    $datum = StringReplace($datum, "Tue", "Di")
    $datum = StringReplace($datum, "Wed", "Mi")
    $datum = StringReplace($datum, "Thu", "Do")
    $datum = StringReplace($datum, "Fri", "Fr")
    $datum = StringReplace($datum, "Sat", "Sa")
    $datum = StringReplace($datum, "Sun", "So")
    Else
    $datum = "Kein Timestamp!"
    EndIf

    [/autoit] [autoit][/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

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

    EndIf
    WEnd

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

    ;++++++++++++++++++++++++++++++++++++++++++++++++++++
    ;Funktionen
    ;++++++++++++++++++++++++++++++++++++++++++++++++++++

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

    Func ExitEvent()
    Exit
    EndFunc

    [/autoit]

    Die einzubindende (modifizierte) UnixTime.au3: (Orginialquelle: http://www.therks.com/autoit/udfs/UnixTime.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] [autoit][/autoit] [autoit][/autoit]

    2 Mal editiert, zuletzt von ip_trainer (3. März 2011 um 15:35)

  • Ich hatte da gerade ne Quick 'n dirty Lösung gebastelt:

    Spoiler anzeigen

    [autoit]
    #include "UnixTime.au3"
    #include <IE.au3>

    Local $hp = "localhost/phpmyadmin", $dataold = ""

    $oIE = _IECreate($hp)
    While 1
    $clip = ClipGet()
    _IEAction($oIE, "copy")
    $data = ClipGet()
    If $dataold <> $data Then
    StringRegExp($data, "\A\d{9,10}\Z", 2)
    If Not @error Then
    ToolTip(_StringFormatTime('%c', $data))
    Else
    Tooltip("")
    EndIf
    $dataold = $data
    EndIf
    ClipPut($clip)
    Sleep(500)
    WEnd
    [autoit]

    Vorteil wäre dass man die Zwischenablage weiterhin normal verwenden kann. Man braucht lediglich den Timestamp im Explorerfenster markieren.

    Vllt kannst dus ja noch gebrauchen ^^
    Ansonsten auch immer schön wenn die Fragenden selbst eine Lösung finden :)

  • Hi Schnitzel,

    trotzdem noch vielen Dank für deine Arbeit! Und den Tip mit der Zwischenablage setze ich noch um - ich habe gerade nachgeschaut, dass man mit ClipPut ja auch wieder Daten in die Zwischenablage zurückschieben kann... dann könnte man ja solange einen ggf. vorhandenen Inhalt vorhalten und nach dem Tooltip wieder zurückschreiben.

    Gruß
    trainer

  • Hi zusammen,

    hier nun die neueste Version. Zusätzlich zum Einzel-Popup kann nun eine ganze Seite übersetzt werden (Timestamps werden umgewandelt und grün dargestellt).

    Bedienung: STRG+ALT+ENTER übersetzt und stellt die Originalseite wieder her (alternierend). Popups wie gehabt (s. oben). Dabei geht die Zwischenablage allerdings immer noch flöten. Ich habe es nicht hinbekommen, ohne die von Schnitzel vorgeschlagene Variante mit _IEAction($oIE, "copy") zu verwenden - wobei dann bei der ersten Verwendung vom IE nachgefragt wird, ob der Zugriff auf die Zwischenablage gestattet werden soll - was ich dann auch nicht wollte... (Trotzdem noch mal vielen Dank für deine Hilfe!)

    Nötige Benutzereinstellungen: nur der Pfad zur phpMyAdmin-Seite muss angepasst werden

    Was noch verbessert werden könnte:
    - Zwischenablage bei Tooltips erhalten
    - GUI zu Konfiguration (Pfad, Farbe, Datumsformat, Dauerübersetzen ein/aus, max. Größe der zu erfassenden Zahlen)
    - Mehrere Fenster/Tabs verwaltbar machen
    - Alternativer Übersetzungsmodus beim Darüberfahren mit der Maus über das TrayIcon

    Falls ich irgendwann noch Lust und Zeit habe, mache ich noch weiter - jetzt ist aber erst mal genug :P ...

    Gruß
    Trainer

    Spoiler anzeigen
    [autoit]


    ;++++++++++++++++++++++++++++++++++++++++++++++++++++
    ; Optionen und Includes
    ;++++++++++++++++++++++++++++++++++++++++++++++++++++
    #include-once
    #include "IE.au3"
    #include "Misc.au3"

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

    ;Tray-Menü anpassen
    Opt("TrayOnEventMode",1)
    Opt("TrayMenuMode",1)
    $exit = TrayCreateItem("Exit")
    TrayItemSetOnEvent(-1,"ExitEvent")

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

    ;Nur einen Start zulassen
    If _Singleton("ClearView",1) = 0 Then Exit

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

    ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ;Pfad zur phpMyAdmin-Seite
    $phpMyAdminURL = "http://www.BEISPIEL-DOMAIN/phpMyAdmin/"
    ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

    ;Variablen / Startwerte definieren
    Global $clear_view = False
    Global $oIE
    Global $oFrame
    Global $content

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

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

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

    ;Aktionen überwachen
    While 1

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

    ;Maus-Tooltip für einen Wert (STRG-Taste und linke Maustaste)
    If _IsPressed(11, $dll_handle) AND _IsPressed(01, $dll_handle) Then
    show_tooltip()

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

    ; Ganze Seite: übersetzen (STRG + ALT + ENTER)
    ElseIf $clear_view = False And _IsPressed("11", $dll_handle) AND _IsPressed("12", $dll_handle) AND _IsPressed("0D", $dll_handle) Then
    translate_page()

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

    ;Ganze Seite: Original wieder herstellen (STRG + ALT + ENTER)
    ElseIf $clear_view = True And _IsPressed("11", $dll_handle) AND _IsPressed("12", $dll_handle) AND _IsPressed("0D", $dll_handle) Then
    restore_page()

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

    EndIf

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

    Sleep(50)

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

    WEnd

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

    ;++++++++++++++++++++++++++++++++++++++++++++++++++++
    ;Funktionen
    ;++++++++++++++++++++++++++++++++++++++++++++++++++++
    Func show_tooltip() ;Maus-Tooltiup anzeigen

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

    ;Text aus der Zwischenablage holen
    Sleep(250); Kurz warten, damit die Markierung per STRG-Klick vor dem Kopieren sauber durchgeführt werden kann
    Send("^{INS}")
    $text = ClipGet()

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

    ;Lesbares Datum erzeugen
    ;Nur Zahlen bis 1999999999 ==> 18.05.2033 (05:33:19 Uhr) umwandeln. Erhöht die Wahrscheinlichkeit nur "echte" timestamps zu erwischen. Ggf anpassen.
    If StringLen($text)=10 AND $text <= 1999999999 THEN
    $format = "%a, %d.%m.%Y - %H:%M:%S Uhr"
    $datum = _StringFormatTime($format, $text)
    $datum = StringReplace($datum, "Mon", "Mo")
    $datum = StringReplace($datum, "Tue", "Di")
    $datum = StringReplace($datum, "Wed", "Mi")
    $datum = StringReplace($datum, "Thu", "Do")
    $datum = StringReplace($datum, "Fri", "Fr")
    $datum = StringReplace($datum, "Sat", "Sa")
    $datum = StringReplace($datum, "Sun", "So")
    Else
    $datum = "Kein Timestamp!"
    EndIf

    [/autoit] [autoit][/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
    EndIf
    WEnd

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

    EndFunc

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

    ;++++++++++++++++++++++++++++++++++++++++++++++++++++

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

    Func translate_page() ;Ganze Seite übersetzen

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

    If $oIE = "" Then $oIE = _IEAttach($phpMyAdminURL, "URL")

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

    $oFrame = _IEFrameGetObjByName ($oIE, "frame_content")
    If Not @error Then

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

    $content = _IEBodyReadHTML($oFrame)

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

    $content_array = StringSplit($content, @CR)
    $content_new = ""

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

    For $i = 1 To UBound($content_array) -1

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

    $input = $content_array[$i]
    $output = $input

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

    ;Nur Zahlen bis 1999999999 ==> 18.05.2033 (05:33:19 Uhr) umwandeln. Erhöht die Wahrscheinlichkeit nur "echte" timestamps zu erwischen. Ggf anpassen.
    ;< und > sind die Zellenbegrenzungszeichen ==> <td>Zahl</td>
    $check = StringRegExp ($input, ">[0-1][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]<", 1)
    If $check <> 0 Then

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

    ;Zellen-Begrenzungszeichen abschneiden
    $datum = StringMid($check[0], 2, 10)

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

    ;Datum formatieren / übersetzen
    $format = "%a, %d.%m.%Y - %H:%M:%S Uhr"

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

    $datum = _StringFormatTime($format, $datum)
    $datum = StringReplace($datum, "Mon", "Mo")
    $datum = StringReplace($datum, "Tue", "Di")
    $datum = StringReplace($datum, "Wed", "Mi")
    $datum = StringReplace($datum, "Thu", "Do")
    $datum = StringReplace($datum, "Fri", "Fr")
    $datum = StringReplace($datum, "Sat", "Sa")
    $datum = StringReplace($datum, "Sun", "So")

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

    ;Farblich hervorheben
    $output = "<span style='color:#008000'>" & $datum & "</span>"

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

    ;Durch formatiertes Datum ersetzen
    $output = StringRegExpReplace ($input, "[0-1][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]", $output, 1)

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

    ;Uhrzeit nur anzeigen, wenn nicht 0 Uhr
    If StringInStr($output, " - 00:00:00 Uhr") Then $output = StringReplace($output, " - 00:00:00 Uhr", "")
    EndIf

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

    $content_new &= $output & @CR

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

    Next

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

    ;Im Quelltext vermerken, dass er übersetzt wurde
    $content_new &= "<!--clearview-->"

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

    _IEAction ($oFrame, "unselect")
    _IEBodyWriteHTML ($oFrame, $content_new)
    _IELoadWait ($oFrame)

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

    $clear_view = True
    Sleep(200)

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

    EndIf

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

    EndFunc

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

    ;++++++++++++++++++++++++++++++++++++++++++++++++++++

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

    Func restore_page() ;Original wieder herstellen

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

    ;Checken, ob der Quelltext übersetzt wurde, oder ob die Seite neu geladen wurde
    If $oIE = "" Then $oIE = _IEAttach($phpMyAdminURL, "URL")

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

    $content_check = _IEBodyReadHTML($oFrame)
    If Not @error Then

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

    ;Zurückübersetzen
    If StringInStr($content_check, "<!--clearview-->") Then
    _IEAction ($oFrame, "unselect")
    _IEBodyWriteHTML ($oFrame, $content)
    _IELoadWait ($oFrame)

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

    $clear_view = False
    Sleep(200)

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

    ;Neu übersetzen
    Else
    $clear_view = False

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

    EndIf

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

    EndIf

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

    EndFunc

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

    ;++++++++++++++++++++++++++++++++++++++++++++++++++++

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

    Func ExitEvent() ;Programm beenden
    Exit
    EndFunc

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

    ;++++++++++++++++++++++++++++++++++++++++++++++++++++

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

    Func _StringFormatTime($s_Format, $i_Timestamp = -1, $i_MaxLen = 255) ;UnixTimeStamp umrechnen

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

    ;Ausschnitt der UnixTime.au3 (Author: Rob Saunders - [email='admin@therks.com'][/email])
    ;Modifiziert von mir (Trainer): Verwendung der 'msvcrt.dll' anstatt 'msvcrt.dll' & Return-Wert

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

    Local $struct_Time, $ptr_Time, $av_Time, $av_StrfTime

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

    If $i_Timestamp = default OR $i_Timestamp < 0 Then Return False ;_TimeGetStamp()
    $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] [autoit][/autoit] [autoit][/autoit]