1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder

ConfluenceHunter Anfänger

  • Mitglied seit 6. Februar 2024
  • Letzte Aktivität: 11. Februar 2024 um 14:23
Beiträge
2
Punkte
15
Profil-Aufrufe
208
  • Beiträge
  • Themen
  • Pinnwand
  • Letzte Aktivitäten
  • Über mich
ConfluenceHunter
10. Februar 2024 um 13:02

Hallo

ich brauche jetzt doch Hilfe, nachdem ich zwei Tage versucht habe eine Lösung zu finden.

Ich habe eine Eingabemaske und möchte die Anzahl der Sekunden zwischen der aktuellen Zeit und den Eingabewerten ($Date1 sowie $idTime ) und der aktuellen Zeit ermitteln.

_DateDiff('s', ?, _NowCalc()) durch welche Variable muß das ? ersetzt werden

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#include <MsgBoxConstants.au3>


Example()

Func Example()

#Region ### START Koda GUI section ### Form=e:\autoit\scripte\eingabefeld.kxf
$Form1_1 = GUICreate("Wann soll die Ladung beginnen ? ", 345, 250, 800, 300)
$Input1 = GUICtrlCreateInput("10", 71, 25, 35, 27)
GUICtrlSetFont(-1, 12, 800, 0, "Times New Roman")
$Button1 = GUICtrlCreateButton("OK", 200, 190, 49, 41)
GUICtrlSetFont(-1, 12, 800, 0, "Times New Roman")
$Label1 = GUICtrlCreateLabel("KWh", 119, 29, 49, 23)
GUICtrlSetFont(-1, 12, 800, 0, "Times New Roman")
$Date1 = GUICtrlCreateDate(_NowDate, 71,75, 197, 27)
GUICtrlSetFont(-1, 12, 800, 0, "Times New Roman")
Global $idTime = GUICtrlCreateDate("", 71, 130, 197, 27, $DTS_TIMEFORMAT)
GUICtrlSetFont(-1, 12, 800, 0, "Times New Roman")
global $sDate
Global $sTime
Global $iUebergabe
Global $date1
Global $iDateCalc
Global $iStartzeit
Global $iStartzeit2
Global $idDate
Global $iDate
global $iStart
Global $sStyle = "HH:mm:ss"

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $Button1
ExitLoop
EndSwitch
WEnd


Global $sDate = GUICtrlRead($idDate)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sDate = ' & $sDate & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
Global $sTime = GUICtrlRead($idTime)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sTime = ' & $sTime & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console


Global $sDt = StringRegExpReplace($sDate, '(\d{2})\.(\d{2})\.(\d{4})', '$3$2$1')
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sDt = ' & $sDt & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
Global $sTm = StringReplace($sTime, ':', '')
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sTm = ' & $sTm & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console

Local $sStyle = "yyyy/MM/dd"
GUICtrlSendMsg($Date1, $DTM_SETFORMATW, 0, $sStyle)

MsgBox(0,"Datum/Zeit","Datum " & GUICtrlRead($Date1) & " Std " & GUICtrlRead($idTime))

MsgBox (64,"Date ",GUICtrlRead($Date1))

MsgBox (64,"Time ",GUICtrlRead($idTime))

EndFunc


Danke im voraus

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™