Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. [Gelöst] Uhrzeit immer eine Stunde zuviel

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    [Gelöst] Uhrzeit immer eine Stunde zuviel

    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Atredis last edited by Atredis

      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 Blockly

      Ach Java Script Engine 4.6.17

      Bildschirmfoto 2020-08-05 um 11.30.40.png

      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>
      
      paul53 1 Reply Last reply Reply Quote 0
      • paul53
        paul53 @Atredis last edited by paul53

        @Atredis
        Die Konvertierungen sind nicht für Zeitdifferenzen geeignet sondern nur für Uhrzeiten, denn sie berücksichtigen die Zeitzone.

        Blockly_temp.JPG

        A 1 Reply Last reply Reply Quote 1
        • A
          Atredis @paul53 last edited by

          @paul53

          Das ist ja dann eine Einfache Lösung.

          Super danke

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Support us

          ioBroker
          Community Adapters
          Donate

          995
          Online

          31.7k
          Users

          79.9k
          Topics

          1.3m
          Posts

          2
          3
          811
          Loading More Posts
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes
          Reply
          • Reply as topic
          Log in to reply
          Community
          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
          The ioBroker Community 2014-2023
          logo