Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Entwicklung
    4. Problem mit Datumsberechnung - Heute + X Tage

    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

    Problem mit Datumsberechnung - Heute + X Tage

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

      Hallo!
      Irgendwie steh ich auf dem Schlauch - ich würde gerne zum heutigen Wert X Tage hinzufügen. Folgenden Ansatz habe ich dazu:

      var now = new Date(); //todays date
       var newDate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + '10')
      adapter.log.info(name + ': ' + now + ' = ' +newDate);
      

      Leider kommt hier aber nix sinnvolles raus:
      adddays 10: Sat Jul 06 2019 08:32:39 GMT+0200 (CEST) = Mon Mar 01 2021 08:32:39 GMT+0100 (CET)
      Habt ihr eine Ahnung, woran das liegen kann? Hab es schon im Online Editor ausprobiert, da funktioniert der Code..

      Danke,
      Jack

      liv-in-sky 1 Reply Last reply Reply Quote 0
      • liv-in-sky
        liv-in-sky @jackblackson last edited by

        @jackblackson
        evtl : get Date gibt dir eine nummer und du addierst einen string ?

        jackblackson 1 Reply Last reply Reply Quote 1
        • jackblackson
          jackblackson @liv-in-sky last edited by

          @liv-in-sky ich versinke im Boden 😧 - danke, nach der Umwandlung in int funktioniert es.

          liv-in-sky 1 Reply Last reply Reply Quote 0
          • liv-in-sky
            liv-in-sky @jackblackson last edited by

            @jackblackson

            wer kennt sowas nicht, der werfe den ersten stein 🙂

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

            Support us

            ioBroker
            Community Adapters
            Donate

            951
            Online

            31.9k
            Users

            80.3k
            Topics

            1.3m
            Posts

            2
            4
            126
            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