NEWS
[Gelöst] Uhrzeit immer eine Stunde zuviel
-
Hallo.
Ich wollte mir die Laufzeit meiner Spülmaschine anzeigen lassen.
Dabei bin ich auf ein merkwürdiges verhalten gestoßen das immer eine Stunde mehr berechnet wird als es wirklich sein sollte.
Also hier in dem Beispiel werden jetzt 8h Differenz angezeigt.
Das Problem kann ich zwar lösen indem ich den deaktivierten Block nehme aber dann sind die Zeitwerte die ich Speichern will ja falsch wenn man diese in anderer art und weise zum rechnen nehmen will.
Jetzt ist meine Frage ist das Richtig so oder ein Fehler. Vielleicht ist ja die Programmier Logik eine andere als meine.
Hier einmal das BlocklyAch Java Script Engine 4.6.17

Zum Testen
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="bl=bUiN$U8Uwp9p(1|s/">Start</variable> <variable id="?]XG.=mxqkP~Zj[n{_pI">Ende</variable> <variable id="4.BGxaCPF{E$,0l*y;ug">Gesamt</variable> </variables> <block type="variables_set" id="-^QC.YjV]%phH]kV?+Z_" x="88" y="88"> <field name="VAR" id="bl=bUiN$U8Uwp9p(1|s/">Start</field> <value name="VALUE"> <block type="convert_from_date" id="=HVS(7(yMUY#9s:|kNk="> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">object</field> <value name="VALUE"> <block type="text" id="OeOd}(v|6MZ4.%`]$3LN"> <field name="TEXT">0:00</field> </block> </value> </block> </value> <next> <block type="variables_set" id="X5~6mGR_i#BD84nD.{`8"> <field name="VAR" id="?]XG.=mxqkP~Zj[n{_pI">Ende</field> <value name="VALUE"> <block type="convert_from_date" id="mlJ/L)O:sI)Do%h6*`Q^"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">object</field> <value name="VALUE"> <block type="text" id="XJHn?|])Z%*5ZC42h%aV"> <field name="TEXT">7:00</field> </block> </value> </block> </value> <next> <block type="variables_set" id="UZTL.H+vuBvn^)_z#:_A" disabled="true"> <field name="VAR" id="4.BGxaCPF{E$,0l*y;ug">Gesamt</field> <value name="VALUE"> <block type="math_arithmetic" id="vn[CNBrvWIZ{p0rs/WZ2"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number" id="E.QKw9!@j*C[;`.jOrBd"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id="l)Q;-YYOmTt6B!!GhoFH"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number" id="]ECm^o8_ij57HfUu{bZq"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="L,u5=3t(t1?KeFXWZvqn"> <field name="VAR" id="?]XG.=mxqkP~Zj[n{_pI">Ende</field> </block> </value> <value name="B"> <shadow type="math_number" id="v|E@%2dKT%8SZ%NN6}nt"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="bqnI%toq5N^i~{%c1LBZ"> <field name="VAR" id="bl=bUiN$U8Uwp9p(1|s/">Start</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="Qm9:!Ae8fQZZez9Jn[0d"> <field name="NUM">3600000</field> </shadow> </value> </block> </value> <next> <block type="variables_set" id="hS14,vtN_$n%XEAgCxW{"> <field name="VAR" id="4.BGxaCPF{E$,0l*y;ug">Gesamt</field> <value name="VALUE"> <block type="math_arithmetic" id="j_?@=ucYh9Dong{B`shO"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id="fHXVp:[]o5uqW{V$|]ot"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="B`4t.TxJe6e9`6VUj9[z"> <field name="VAR" id="?]XG.=mxqkP~Zj[n{_pI">Ende</field> </block> </value> <value name="B"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="OT,S_VXFzM!1[B!NHE.h"> <field name="VAR" id="bl=bUiN$U8Uwp9p(1|s/">Start</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="Y;{D;1!HP4y%Z4*M[:{q"> <field name="NUM">0</field> </shadow> </value> </block> </value> <next> <block type="debug" id="A#f9ojdMmU.))-IiXvC,"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="UuUBv:p.(d5H2=oh3@3J"> <field name="TEXT">test</field> </shadow> <block type="convert_from_date" id="_3_a-gj.E=rn@%BkW+O`"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">hh:mm</field> <value name="VALUE"> <block type="variables_get" id="qr#tpX+)[Gm7kybquD54"> <field name="VAR" id="4.BGxaCPF{E$,0l*y;ug">Gesamt</field> </block> </value> </block> </value> <next> <block type="debug" id="V.T0WWH/Idx1BsQB8huW"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="K@UJ?-k1.sP?JezQ*v#U"> <field name="TEXT">test</field> </shadow> <block type="convert_from_date" id="MkIWXGG1PnGuM;aTHVq|"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">h</field> <value name="VALUE"> <block type="variables_get" id="F)WkTe{AThI,bH}9;}Vc"> <field name="VAR" id="4.BGxaCPF{E$,0l*y;ug">Gesamt</field> </block> </value> </block> </value> <next> <block type="debug" id="ugIC@)nJ6nH0$7Fx~/Tg"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="HZ.Qr6ugJ,(t1#Fz2v?S"> <field name="TEXT">test</field> </shadow> <block type="convert_from_date" id="o2uAxrMMO%o}/qrt7]mj"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">m</field> <value name="VALUE"> <block type="variables_get" id="0*gMJTF-v{PQK8jL?O7V"> <field name="VAR" id="4.BGxaCPF{E$,0l*y;ug">Gesamt</field> </block> </value> </block> </value> <next> <block type="debug" id="n^tUAJp;3@E8Uwn3wNEF"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="nM-09vpmr8327^9d1]l("> <field name="TEXT">test</field> </shadow> <block type="convert_from_date" id="?*.:XkM:fNi9288Favzq"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">object</field> <value name="VALUE"> <block type="variables_get" id="DE2T5cs0:%4{JR)(8J{o"> <field name="VAR" id="4.BGxaCPF{E$,0l*y;ug">Gesamt</field> </block> </value> </block> </value> <next> <block type="debug" id="#c6/%ikgNzE0O-FBC`BF"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="7{RKwokLM*+no`B,y1YQ"> <field name="TEXT">test</field> </shadow> <block type="variables_get" id="vkA;dpd`qCz82NL7Ng62"> <field name="VAR" id="4.BGxaCPF{E$,0l*y;ug">Gesamt</field> </block> </value> <next> <block type="debug" id="*xfy}CSDvwhK+)X!`t:l"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="JRPztE%}CG$D9y++^Xj%"> <field name="TEXT">test</field> </shadow> <block type="variables_get" id="BZUC57)qe9R]f5ed.bZe"> <field name="VAR" id="bl=bUiN$U8Uwp9p(1|s/">Start</field> </block> </value> <next> <block type="debug" id="uoz*$3b06foij.QYn`m."> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="Fyl*}k*x,-o]M]mrpOVa"> <field name="TEXT">test</field> </shadow> <block type="variables_get" id="pj6)BVJ8S:f;xuTPf5fT"> <field name="VAR" id="?]XG.=mxqkP~Zj[n{_pI">Ende</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </xml> -
Hallo.
Ich wollte mir die Laufzeit meiner Spülmaschine anzeigen lassen.
Dabei bin ich auf ein merkwürdiges verhalten gestoßen das immer eine Stunde mehr berechnet wird als es wirklich sein sollte.
Also hier in dem Beispiel werden jetzt 8h Differenz angezeigt.
Das Problem kann ich zwar lösen indem ich den deaktivierten Block nehme aber dann sind die Zeitwerte die ich Speichern will ja falsch wenn man diese in anderer art und weise zum rechnen nehmen will.
Jetzt ist meine Frage ist das Richtig so oder ein Fehler. Vielleicht ist ja die Programmier Logik eine andere als meine.
Hier einmal das BlocklyAch Java Script Engine 4.6.17

Zum Testen
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="bl=bUiN$U8Uwp9p(1|s/">Start</variable> <variable id="?]XG.=mxqkP~Zj[n{_pI">Ende</variable> <variable id="4.BGxaCPF{E$,0l*y;ug">Gesamt</variable> </variables> <block type="variables_set" id="-^QC.YjV]%phH]kV?+Z_" x="88" y="88"> <field name="VAR" id="bl=bUiN$U8Uwp9p(1|s/">Start</field> <value name="VALUE"> <block type="convert_from_date" id="=HVS(7(yMUY#9s:|kNk="> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">object</field> <value name="VALUE"> <block type="text" id="OeOd}(v|6MZ4.%`]$3LN"> <field name="TEXT">0:00</field> </block> </value> </block> </value> <next> <block type="variables_set" id="X5~6mGR_i#BD84nD.{`8"> <field name="VAR" id="?]XG.=mxqkP~Zj[n{_pI">Ende</field> <value name="VALUE"> <block type="convert_from_date" id="mlJ/L)O:sI)Do%h6*`Q^"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">object</field> <value name="VALUE"> <block type="text" id="XJHn?|])Z%*5ZC42h%aV"> <field name="TEXT">7:00</field> </block> </value> </block> </value> <next> <block type="variables_set" id="UZTL.H+vuBvn^)_z#:_A" disabled="true"> <field name="VAR" id="4.BGxaCPF{E$,0l*y;ug">Gesamt</field> <value name="VALUE"> <block type="math_arithmetic" id="vn[CNBrvWIZ{p0rs/WZ2"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number" id="E.QKw9!@j*C[;`.jOrBd"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id="l)Q;-YYOmTt6B!!GhoFH"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number" id="]ECm^o8_ij57HfUu{bZq"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="L,u5=3t(t1?KeFXWZvqn"> <field name="VAR" id="?]XG.=mxqkP~Zj[n{_pI">Ende</field> </block> </value> <value name="B"> <shadow type="math_number" id="v|E@%2dKT%8SZ%NN6}nt"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="bqnI%toq5N^i~{%c1LBZ"> <field name="VAR" id="bl=bUiN$U8Uwp9p(1|s/">Start</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="Qm9:!Ae8fQZZez9Jn[0d"> <field name="NUM">3600000</field> </shadow> </value> </block> </value> <next> <block type="variables_set" id="hS14,vtN_$n%XEAgCxW{"> <field name="VAR" id="4.BGxaCPF{E$,0l*y;ug">Gesamt</field> <value name="VALUE"> <block type="math_arithmetic" id="j_?@=ucYh9Dong{B`shO"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id="fHXVp:[]o5uqW{V$|]ot"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="B`4t.TxJe6e9`6VUj9[z"> <field name="VAR" id="?]XG.=mxqkP~Zj[n{_pI">Ende</field> </block> </value> <value name="B"> <shadow type="math_number"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="OT,S_VXFzM!1[B!NHE.h"> <field name="VAR" id="bl=bUiN$U8Uwp9p(1|s/">Start</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="Y;{D;1!HP4y%Z4*M[:{q"> <field name="NUM">0</field> </shadow> </value> </block> </value> <next> <block type="debug" id="A#f9ojdMmU.))-IiXvC,"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="UuUBv:p.(d5H2=oh3@3J"> <field name="TEXT">test</field> </shadow> <block type="convert_from_date" id="_3_a-gj.E=rn@%BkW+O`"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">hh:mm</field> <value name="VALUE"> <block type="variables_get" id="qr#tpX+)[Gm7kybquD54"> <field name="VAR" id="4.BGxaCPF{E$,0l*y;ug">Gesamt</field> </block> </value> </block> </value> <next> <block type="debug" id="V.T0WWH/Idx1BsQB8huW"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="K@UJ?-k1.sP?JezQ*v#U"> <field name="TEXT">test</field> </shadow> <block type="convert_from_date" id="MkIWXGG1PnGuM;aTHVq|"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">h</field> <value name="VALUE"> <block type="variables_get" id="F)WkTe{AThI,bH}9;}Vc"> <field name="VAR" id="4.BGxaCPF{E$,0l*y;ug">Gesamt</field> </block> </value> </block> </value> <next> <block type="debug" id="ugIC@)nJ6nH0$7Fx~/Tg"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="HZ.Qr6ugJ,(t1#Fz2v?S"> <field name="TEXT">test</field> </shadow> <block type="convert_from_date" id="o2uAxrMMO%o}/qrt7]mj"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">m</field> <value name="VALUE"> <block type="variables_get" id="0*gMJTF-v{PQK8jL?O7V"> <field name="VAR" id="4.BGxaCPF{E$,0l*y;ug">Gesamt</field> </block> </value> </block> </value> <next> <block type="debug" id="n^tUAJp;3@E8Uwn3wNEF"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="nM-09vpmr8327^9d1]l("> <field name="TEXT">test</field> </shadow> <block type="convert_from_date" id="?*.:XkM:fNi9288Favzq"> <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation> <field name="OPTION">object</field> <value name="VALUE"> <block type="variables_get" id="DE2T5cs0:%4{JR)(8J{o"> <field name="VAR" id="4.BGxaCPF{E$,0l*y;ug">Gesamt</field> </block> </value> </block> </value> <next> <block type="debug" id="#c6/%ikgNzE0O-FBC`BF"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="7{RKwokLM*+no`B,y1YQ"> <field name="TEXT">test</field> </shadow> <block type="variables_get" id="vkA;dpd`qCz82NL7Ng62"> <field name="VAR" id="4.BGxaCPF{E$,0l*y;ug">Gesamt</field> </block> </value> <next> <block type="debug" id="*xfy}CSDvwhK+)X!`t:l"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="JRPztE%}CG$D9y++^Xj%"> <field name="TEXT">test</field> </shadow> <block type="variables_get" id="BZUC57)qe9R]f5ed.bZe"> <field name="VAR" id="bl=bUiN$U8Uwp9p(1|s/">Start</field> </block> </value> <next> <block type="debug" id="uoz*$3b06foij.QYn`m."> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="Fyl*}k*x,-o]M]mrpOVa"> <field name="TEXT">test</field> </shadow> <block type="variables_get" id="pj6)BVJ8S:f;xuTPf5fT"> <field name="VAR" id="?]XG.=mxqkP~Zj[n{_pI">Ende</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </xml> -
@Atredis
Die Konvertierungen sind nicht für Zeitdifferenzen geeignet sondern nur für Uhrzeiten, denn sie berücksichtigen die Zeitzone.
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren Anmelden