Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Error/Bug
    4. Konvertierung Datum mit formatDate()

    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

    Konvertierung Datum mit formatDate()

    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      TT-Tom last edited by

      Hallo,
      ich habe ein Problem mit der Datumkonvertierung. Nach meinen Tests geht der ioBroker von einem englischen Datum aus, obwohl die Einstellungen im Broker und Raspi auf Deutsch zeigen. Ist das prinzipiell so oder habe ich eine Einstellung vergessen?

      ich habe diese Script benutzt

      let val = '12.01.2023'
      console.log(val);
      console.log(formatDate(getDateObject(val), "TT.MM."));
      if (typeof(val) == 'string') {
                              console.log('String')
                              console.log(Date.parse(val))
                              if (!isNaN(Date.parse(val))) {
                                  console.log('!isNaN')
                                  console.log(formatDate(Date.parse(val)), 'TT.MM.YY')
                              }
                          }
      

      hier das Ergebnis

      08:13:36.512    info    javascript.1 (1083485) script.js.common.Testcenter.test: 12.01.2023
      08:13:36.512    info    javascript.1 (1083485) script.js.common.Testcenter.test: 01.12.
      08:13:36.512    info    javascript.1 (1083485) script.js.common.Testcenter.test: String
      08:13:36.513    info    javascript.1 (1083485) script.js.common.Testcenter.test: 1701385200000
      08:13:36.513    info    javascript.1 (1083485) script.js.common.Testcenter.test: !isNaN
      08:13:36.513    info    javascript.1 (1083485) script.js.common.Testcenter.test: 01.12.2023
      

      wenn ich jetzt den 13.01.23 nehme kommt das raus

      08:16:44.673    info    javascript.1 (1083485) script.js.common.Testcenter.test: 13.01.2023
      08:16:44.674    info    javascript.1 (1083485) script.js.common.Testcenter.test: NaN.NaN.
      08:16:44.674    info    javascript.1 (1083485) script.js.common.Testcenter.test: String
      08:16:44.674    info    javascript.1 (1083485) script.js.common.Testcenter.test: NaN
      

      solange der Tag kleiner als der 13 ist, wird der Tag als Monat erkannt und umgeschrieben.

      Skript v.2023-10-10
      
      *** BASE SYSTEM ***
         Static hostname: iobmaster
               Icon name: computer
        Operating System: Debian GNU/Linux 11 (bullseye)
                  Kernel: Linux 6.1.21-v8+
            Architecture: arm64
      
      Model		: Raspberry Pi 4 Model B Rev 1.4
      Docker          : false
      Virtualization  : none
      Kernel          : aarch64
      Userland        : arm64
      
      Systemuptime and Load:
       08:37:40 up 18 days, 15:08,  1 user,  load average: 1.88, 1.59, 1.07
      CPU threads: 4
      
      
      *** RASPBERRY THROTTLING ***
      Current issues:
      No throttling issues detected.
      
      Previously detected issues:
      No throttling issues detected.
      
      This system needs to be REBOOTED!
      
      
      *** Time and Time Zones ***
                     Local time: Thu 2023-10-26 08:37:40 CEST
                 Universal time: Thu 2023-10-26 06:37:40 UTC
                       RTC time: n/a
                      Time zone: Europe/Berlin (CEST, +0200)
      System clock synchronized: yes
                    NTP service: active
                RTC in local TZ: no
      
      *** User and Groups ***
      pi
      /home/pi
      pi adm dialout cdrom sudo audio video plugdev games users input render netdev gpio i2c spi iobroker
      
      *** X-Server-Setup ***
      X-Server: 	false
      Desktop: 	
      Terminal: 	tty
      Boot Target: 	graphical.target
      
      *** MEMORY ***
                     total        used        free      shared  buff/cache   available
      Mem:            7.8G        3.3G        3.3G        0.0K        1.2G        4.4G
      Swap:            99M         31M         68M
      Total:          7.9G        3.3G        3.4G
      
               7811 M total memory
               3297 M used memory
               1777 M active memory
               2412 M inactive memory
               3332 M free memory
                 17 M buffer memory
               1164 M swap cache
                 99 M total swap
                 31 M used swap
                 68 M free swap
      
      Raspberry only:
      oom events: 0
      lifetime oom required: 0 Mbytes
      total time in oom handler: 0 ms
      max time spent in oom handler: 0 ms
      
      *** FAILED SERVICES ***
      
        UNIT LOAD ACTIVE SUB DESCRIPTION
      0 loaded units listed.
      
      *** FILESYSTEM ***
      Filesystem     Type      Size  Used Avail Use% Mounted on
      /dev/root      ext4      470G  7.7G  443G   2% /
      devtmpfs       devtmpfs  3.6G     0  3.6G   0% /dev
      tmpfs          tmpfs     3.9G     0  3.9G   0% /dev/shm
      tmpfs          tmpfs     1.6G  920K  1.6G   1% /run
      tmpfs          tmpfs     5.0M  4.0K  5.0M   1% /run/lock
      /dev/sdb1      ext4       15G   25M   14G   1% /mnt/Stick
      /dev/sda1      vfat      253M   32M  221M  13% /boot
      tmpfs          tmpfs     782M     0  782M   0% /run/user/1000
      
      Messages concerning ext4 filesystem in dmesg:
      [Sat Oct  7 17:28:40 2023] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_headphones=0 snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_hdmi=0  smsc95xx.macaddr=E4:5F:01:31:13:73 vc_mem.mem_base=0x3eb00000 vc_mem.mem_size=0x3ff00000  console=tty1 root=PARTUUID=6755e206-02 rootfstype=ext4 fsck.repair=yes rootwait
      [Sat Oct  7 17:28:42 2023] EXT4-fs (sda2): mounted filesystem with ordered data mode. Quota mode: none.
      [Sat Oct  7 17:28:42 2023] VFS: Mounted root (ext4 filesystem) readonly on device 8:2.
      [Sat Oct  7 17:28:45 2023] EXT4-fs (sda2): re-mounted. Quota mode: none.
      [Sat Oct  7 17:28:46 2023] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Quota mode: none.
      
      Show mounted filesystems \(real ones only\):
      TARGET       SOURCE    FSTYPE OPTIONS
      /            /dev/sda2 ext4   rw,noatime
      |-/mnt/Stick /dev/sdb1 ext4   rw,nosuid,nodev,noexec,relatime
      `-/boot      /dev/sda1 vfat   rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,flush,errors=remount-ro
      
      Files in neuralgic directories:
      
      /var:
      2.8G	/var/
      2.1G	/var/log/journal/dd7bfb316aa7459eb693f8d9fd5f26f4
      2.1G	/var/log/journal
      2.1G	/var/log
      449M	/var/cache
      
      Archived and active journals take up 2.0G in the file system.
      
      /opt/iobroker/backups:
      280M	/opt/iobroker/backups/
      
      /opt/iobroker/iobroker-data:
      443M	/opt/iobroker/iobroker-data/
      234M	/opt/iobroker/iobroker-data/files
      90M	/opt/iobroker/iobroker-data/backup-objects
      80M	/opt/iobroker/iobroker-data/history
      52M	/opt/iobroker/iobroker-data/files/javascript.admin
      
      The five largest files in iobroker-data are:
      35M	/opt/iobroker/iobroker-data/files/devices.admin/static/js/main.24f2bb56.js.map
      28M	/opt/iobroker/iobroker-data/objects.jsonl
      21M	/opt/iobroker/iobroker-data/files/web.admin/static/js/main.edf7552a.js.map
      15M	/opt/iobroker/iobroker-data/states.jsonl
      8.6M	/opt/iobroker/iobroker-data/files/devices.admin/static/js/main.24f2bb56.js
      
      USB-Devices by-id:
      USB-Sticks -  Avoid direct links to /dev/* in your adapter setups, please always prefer the links 'by-id':
      
      /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0067-if00-port0
      /dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0
      
      *** NodeJS-Installation ***
      
      /usr/bin/nodejs 	v18.18.2
      /usr/bin/node 		v18.18.2
      /usr/bin/npm 		9.8.1
      /usr/bin/npx 		9.8.1
      /usr/bin/corepack 	0.19.0
      
      
      nodejs:
        Installed: 18.18.2-1nodesource1
        Candidate: 18.18.2-1nodesource1
        Version table:
       *** 18.18.2-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
              100 /var/lib/dpkg/status
           18.18.1-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.18.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.17.1-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.17.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.16.1-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.16.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.15.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.14.2-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.14.1-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.14.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.13.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.12.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.11.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.10.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.9.1-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.9.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.8.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.7.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.6.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.5.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.4.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.3.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.2.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.1.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           18.0.0-1nodesource1 500
              500 https://deb.nodesource.com/node_18.x nodistro/main arm64 Packages
           12.22.12~dfsg-1~deb11u4 500
              500 http://deb.debian.org/debian bullseye/main arm64 Packages
              500 http://security.debian.org/debian-security bullseye-security/main arm64 Packages
      
      Temp directories causing npm8 problem: 0
      No problems detected
      
      Errors in npm tree:
      
      *** ioBroker-Installation ***
      
      ioBroker Status
      iobroker is running on this host.
      
      
      Objects type: jsonl
      States  type: jsonl
      
      Core adapters versions
      js-controller: 	5.0.12
      admin: 		6.10.1
      javascript: 	7.1.4
      
      Adapters from github: 	5
      
      Adapter State
      + system.adapter.accuweather.0            : accuweather           : iobmaster                                -  enabled
      + system.adapter.admin.0                  : admin                 : iobmaster                                -  enabled, port: 8081, bind: 0.0.0.0 (SSL), run as: admin
        system.adapter.alias-manager.0          : alias-manager         : iobmaster                                - disabled
      + system.adapter.backitup.0               : backitup              : iobmaster                                -  enabled
      + system.adapter.device-reminder.0        : device-reminder       : iobmaster                                -  enabled
      + system.adapter.device-watcher.0         : device-watcher        : iobmaster                                -  enabled
        system.adapter.devices.0                : devices               : iobmaster                                - disabled
      + system.adapter.fahrplan.0               : fahrplan              : iobmaster                                -  enabled
        system.adapter.fb-checkpresence.0       : fb-checkpresence      : iobmaster                                - disabled
      + system.adapter.hmip.0                   : hmip                  : iobmaster                                -  enabled
      + system.adapter.homeconnect.0            : homeconnect           : iobmaster                                -  enabled
        system.adapter.hs100.0                  : hs100                 : iobmaster                                - disabled
        system.adapter.ical.0                   : ical                  : iobmaster                                -  enabled
        system.adapter.ical.1                   : ical                  : iobmaster                                -  enabled
        system.adapter.icons-mfd-svg.0          : icons-mfd-svg         : iobmaster                                - disabled
      + system.adapter.influxdb.0               : influxdb              : iobmaster                                -  enabled, port: 8086
      + system.adapter.javascript.0             : javascript            : iobmaster                                -  enabled
      + system.adapter.javascript.1             : javascript            : iobmaster                                -  enabled
      + system.adapter.lgtv.0                   : lgtv                  : iobmaster                                -  enabled
      + system.adapter.logparser.0              : logparser             : iobmaster                                -  enabled
      + system.adapter.mqtt.0                   : mqtt                  : iobmaster                                -  enabled, port: 1883, bind: 0.0.0.0
      + system.adapter.mqtt.1                   : mqtt                  : iobmaster                                -  enabled, port: 1886, bind: 192.168.178.120
      + system.adapter.mqtt.2                   : mqtt                  : iobmaster                                -  enabled, port: 7531, bind: 0.0.0.0
        system.adapter.netatmo-crawler.0        : netatmo-crawler       : iobmaster                                -  enabled
      + system.adapter.parcel.0                 : parcel                : iobmaster                                -  enabled
        system.adapter.philips-air.0            : philips-air           : iobmaster                                - disabled
      + system.adapter.rpi2.0                   : rpi2                  : iobmaster                                -  enabled
      + system.adapter.shelly.0                 : shelly                : iobmaster                                -  enabled, port: 1882, bind: 0.0.0.0
      + system.adapter.shelly.1                 : shelly                : iobmaster                                -  enabled, port: 1882, bind: 0.0.0.0
        system.adapter.simple-api.0             : simple-api            : iobmaster                                - disabled, port: 8087, bind: 0.0.0.0, run as: admin
      + system.adapter.smartmeter.0             : smartmeter            : iobmaster                                -  enabled
        system.adapter.socketio.0               : socketio              : iobmaster                                - disabled, port: 8084, bind: 0.0.0.0 (SSL), run as: admin
      + system.adapter.sourceanalytix.0         : sourceanalytix        : iobmaster                                -  enabled
      + system.adapter.tankerkoenig.0           : tankerkoenig          : iobmaster                                -  enabled
      + system.adapter.trashschedule.0          : trashschedule         : iobmaster                                -  enabled
        system.adapter.vis-icontwo.0            : vis-icontwo           : iobmaster                                - disabled
      + system.adapter.vis-inventwo.0           : vis-inventwo          : iobmaster                                -  enabled
        system.adapter.vis-materialdesign.0     : vis-materialdesign    : iobmaster                                - disabled
        system.adapter.vis-owl.0                : vis-owl               : iobmaster                                - disabled
        system.adapter.vis-timeandweather.0     : vis-timeandweather    : iobmaster                                - disabled
        system.adapter.vis.0                    : vis                   : iobmaster                                -  enabled
      + system.adapter.vw-connect.0             : vw-connect            : iobmaster                                -  enabled
      + system.adapter.web.0                    : web                   : iobmaster                                -  enabled, port: 8082, bind: 0.0.0.0, run as: admin
      + system.adapter.wled.0                   : wled                  : iobmaster                                -  enabled
      + system.adapter.yahka.0                  : yahka                 : iobmaster                                -  enabled
      + system.adapter.yahka.1                  : yahka                 : iobmaster                                -  enabled
      + system.adapter.zigbee.0                 : zigbee                : iobmaster                                -  enabled, port: /dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0
      
      + instance is alive
      
      Enabled adapters with bindings
      + system.adapter.admin.0                  : admin                 : iobmaster                                -  enabled, port: 8081, bind: 0.0.0.0 (SSL), run as: admin
      + system.adapter.influxdb.0               : influxdb              : iobmaster                                -  enabled, port: 8086
      + system.adapter.mqtt.0                   : mqtt                  : iobmaster                                -  enabled, port: 1883, bind: 0.0.0.0
      + system.adapter.mqtt.1                   : mqtt                  : iobmaster                                -  enabled, port: 1886, bind: 192.168.178.120
      + system.adapter.mqtt.2                   : mqtt                  : iobmaster                                -  enabled, port: 7531, bind: 0.0.0.0
      + system.adapter.shelly.0                 : shelly                : iobmaster                                -  enabled, port: 1882, bind: 0.0.0.0
      + system.adapter.shelly.1                 : shelly                : iobmaster                                -  enabled, port: 1882, bind: 0.0.0.0
      + system.adapter.web.0                    : web                   : iobmaster                                -  enabled, port: 8082, bind: 0.0.0.0, run as: admin
      + system.adapter.zigbee.0                 : zigbee                : iobmaster                                -  enabled, port: /dev/serial/by-id/usb-Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001-if00-port0
      
      ioBroker-Repositories
      stable        : http://download.iobroker.net/sources-dist.json
      beta          : http://download.iobroker.net/sources-dist-latest.json
      
      Active repo(s): stable
      
      Installed ioBroker-Instances
      Used repository: stable
      Adapter    "accuweather"  : 1.3.1    , installed 1.3.1
      Adapter    "admin"        : 6.10.1   , installed 6.10.1
      Adapter    "alias-manager": 1.2.6    , installed 1.2.6
      Adapter    "backitup"     : 2.8.1    , installed 2.8.1
      Adapter    "device-reminder": 1.2.9  , installed 1.2.9
      Adapter    "device-watcher": 2.9.3   , installed 2.9.3
      Adapter    "devices"      : 1.1.5    , installed 1.1.5
      Adapter    "fahrplan"     : 1.2.3    , installed 1.2.3
      Adapter    "fb-checkpresence": 1.2.2 , installed 1.2.2
      Adapter    "hmip"         : 1.20.0   , installed 1.20.0
      Adapter    "homeconnect"  : 1.1.1    , installed 1.1.1
      Adapter    "hs100"        : 2.1.2    , installed 2.1.2
      Adapter    "ical"         : 1.13.3   , installed 1.13.3
      Adapter    "icons-mfd-svg": 1.1.0    , installed 1.1.0
      Adapter    "influxdb"     : 3.2.0    , installed 3.2.0
      Adapter    "javascript"   : 7.1.4    , installed 7.1.4
      Controller "js-controller": 5.0.12   , installed 5.0.12
      Adapter    "lgtv"         : 2.1.1    , installed 2.1.1
      Adapter    "logparser"    : 2.2.0    , installed 2.2.0
      Adapter    "mqtt"         : 4.1.1    , installed 4.1.1
      Adapter    "netatmo-crawler": 0.8.1  , installed 0.8.1
      Adapter    "parcel"       : 0.0.27   , installed 0.1.6
      Adapter    "philips-air"  : 1.0.3    , installed 1.0.3
      Adapter    "rpi2"         : 1.3.2    , installed 1.3.2
      Adapter    "shelly"       : 6.4.5    , installed 6.4.1  [Updatable]
      Adapter    "simple-api"   : 2.7.2    , installed 2.7.2
      Adapter    "smartmeter"   : 3.3.4    , installed 3.3.4
      Adapter    "socketio"     : 6.5.5    , installed 6.5.5
      Adapter    "tankerkoenig" : 3.3.7    , installed 3.3.7
      Adapter    "trashschedule": 2.2.0    , installed 2.2.0
      Adapter    "vis"          : 1.4.16   , installed 1.4.16
      Adapter    "vis-icontwo"  : 0.96.0   , installed 0.96.0
      Adapter    "vis-inventwo" : 3.3.3    , installed 3.3.3
      Adapter    "vis-timeandweather": 1.2.2, installed 1.2.2
      Adapter    "vw-connect"   : 0.0.67   , installed 0.1.3
      Adapter    "web"          : 6.1.2    , installed 6.1.2
      Adapter    "wled"         : 0.7.1    , installed 0.7.1
      Adapter    "ws"           : 2.5.5    , installed 2.5.5
      Adapter    "yahka"        : 1.0.3    , installed 1.0.3
      Adapter    "zigbee"       : 1.8.23   , installed 1.8.23
      
      Objects and States
      Please stand by - This may take a while
      Objects: 	11760
      States: 	10218
      
      *** OS-Repositories and Updates ***
      Hit:1 http://deb.debian.org/debian bullseye InRelease
      Hit:2 http://security.debian.org/debian-security bullseye-security InRelease
      Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
      Hit:4 http://archive.raspberrypi.org/debian bullseye InRelease
      Hit:5 https://repos.influxdata.com/debian stable InRelease
      Hit:6 https://deb.nodesource.com/node_18.x nodistro InRelease
      Hit:7 https://packagecloud.io/ookla/speedtest-cli/debian bullseye InRelease
      Reading package lists...
      Pending Updates: 0
      
      *** Listening Ports ***
      Active Internet connections (only servers)
      Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name    
      tcp        0      0 0.0.0.0:1883            0.0.0.0:*               LISTEN      1001       11459457   1083599/io.mqtt.0   
      tcp        0      0 0.0.0.0:1882            0.0.0.0:*               LISTEN      1001       11457322   1083670/io.shelly.1 
      tcp        0      0 127.0.0.1:41829         0.0.0.0:*               LISTEN      1001       19311127   1083926/io.yahka.1  
      tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      1001       11456988   1083429/iobroker.js 
      tcp        0      0 127.0.0.1:9001          0.0.0.0:*               LISTEN      1001       11456981   1083429/iobroker.js 
      tcp        0      0 192.168.178.120:1886    0.0.0.0:*               LISTEN      1001       11459464   1083614/io.mqtt.1   
      tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          6291732    642322/sshd: /usr/s 
      tcp        0      0 0.0.0.0:7531            0.0.0.0:*               LISTEN      1001       11457277   1083625/io.mqtt.2   
      tcp        0      0 127.0.0.1:39441         0.0.0.0:*               LISTEN      1001       19311896   1083915/io.yahka.0  
      tcp6       0      0 :::34287                :::*                    LISTEN      1001       11460777   1083915/io.yahka.0  
      tcp6       0      0 :::45529                :::*                    LISTEN      1001       11461952   1083926/io.yahka.1  
      tcp6       0      0 :::22                   :::*                    LISTEN      0          6291734    642322/sshd: /usr/s 
      tcp6       0      0 :::8082                 :::*                    LISTEN      1001       11462682   1083884/io.web.0    
      tcp6       0      0 :::8081                 :::*                    LISTEN      1001       13622297   1265664/io.admin.0  
      udp        0      0 0.0.0.0:68              0.0.0.0:*                           0          11933      856/dhcpcd          
      udp        0      0 0.0.0.0:5353            0.0.0.0:*                           1001       11461930   1083915/io.yahka.0  
      udp        0      0 0.0.0.0:5353            0.0.0.0:*                           1001       11461929   1083915/io.yahka.0  
      udp        0      0 0.0.0.0:5353            0.0.0.0:*                           1001       11460744   1083899/io.wled.0   
      udp        0      0 0.0.0.0:5353            0.0.0.0:*                           108        13517      411/avahi-daemon: r 
      udp        0      0 0.0.0.0:5683            0.0.0.0:*                           1001       11457259   1083549/io.shelly.0 
      udp        0      0 0.0.0.0:40591           0.0.0.0:*                           108        13519      411/avahi-daemon: r 
      udp6       0      0 :::546                  :::*                                0          6838393    856/dhcpcd          
      udp6       0      0 :::41529                :::*                                108        13520      411/avahi-daemon: r 
      udp6       0      0 :::5353                 :::*                                108        13518      411/avahi-daemon: r 
      
      *** Log File - Last 25 Lines ***
      
      2023-10-26 08:36:35.346  - info: javascript.1 (1780236) script.js.common.Testcenter.test: NaN.NaN.NaN
      2023-10-26 08:36:35.347  - info: javascript.1 (1780236) script.js.common.Testcenter.test: String
      2023-10-26 08:36:35.348  - info: javascript.1 (1780236) script.js.common.Testcenter.test: NaN
      2023-10-26 08:36:35.348  - info: javascript.1 (1780236) script.js.common.Testcenter.test: registered 0 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
      2023-10-26 08:36:35.349  - info: javascript.1 (1780236) Start javascript script.js.common.Daten_zu_InfluxDB.WaermeDatenJS
      2023-10-26 08:36:35.387  - info: javascript.1 (1780236) script.js.common.Daten_zu_InfluxDB.WaermeDatenJS: registered 0 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
      2023-10-26 08:36:35.388  - info: javascript.1 (1780236) Start javascript script.js.common.Daten_zu_InfluxDB.SpeedtestDatenJS
      2023-10-26 08:36:35.420  - info: javascript.1 (1780236) script.js.common.Daten_zu_InfluxDB.SpeedtestDatenJS: registered 0 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
      2023-10-26 08:36:35.420  - info: javascript.1 (1780236) Start javascript script.js.common.Daten_zu_InfluxDB.SourceAnalytixWaermeDatenJS
      2023-10-26 08:36:35.432  - info: javascript.1 (1780236) script.js.common.Daten_zu_InfluxDB.SourceAnalytixWaermeDatenJS: registered 0 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
      2023-10-26 08:36:35.433  - info: javascript.1 (1780236) Start javascript script.js.common.Daten_zu_InfluxDB.SourceAnalytixStromDatenVorJS
      2023-10-26 08:36:35.445  - info: javascript.1 (1780236) script.js.common.Daten_zu_InfluxDB.SourceAnalytixStromDatenVorJS: registered 0 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
      2023-10-26 08:36:35.445  - info: javascript.1 (1780236) Start javascript script.js.common.Daten_zu_InfluxDB.SourceAnalytixStromDatenAktuellJS
      2023-10-26 08:36:35.457  - info: javascript.1 (1780236) script.js.common.Daten_zu_InfluxDB.SourceAnalytixStromDatenAktuellJS: registered 0 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
      2023-10-26 08:36:35.458  - info: javascript.1 (1780236) Start javascript script.js.common.Daten_zu_InfluxDB.Heizung_RaumTempJS
      2023-10-26 08:36:35.469  - info: javascript.1 (1780236) script.js.common.Daten_zu_InfluxDB.Heizung_RaumTempJS: registered 0 subscriptions, 0 schedules, 0 messages, 0 logs and 0 file subscriptions
      2023-10-26 08:36:35.503  - info: javascript.1 (1780236) script.js.common.Daten_zu_InfluxDB.WaermeDatenJS: Starting "waerme" logging to http://iobtest:8086 into bucket "test-48h" by org ioBrokerData
      2023-10-26 08:36:35.505  - info: javascript.1 (1780236) script.js.common.Daten_zu_InfluxDB.SpeedtestDatenJS: Starting "speedtest,host=iobMaster" logging to http://iobtest:8086 into bucket "test-48h" by org ioBrokerData
      2023-10-26 08:36:35.506  - info: javascript.1 (1780236) script.js.common.Daten_zu_InfluxDB.SourceAnalytixWaermeDatenJS: Starting "verbrauch,energie=waerme" logging to http://iobtest:8086 into bucket "Langzeit" by org ioBrokerData
      2023-10-26 08:36:35.515  - info: javascript.1 (1780236) script.js.common.Daten_zu_InfluxDB.SourceAnalytixStromDatenVorJS: Starting "verbrauch,energie=strom" logging to http://iobtest:8086 into bucket "Langzeit" by org ioBrokerData
      2023-10-26 08:36:35.517  - info: javascript.1 (1780236) script.js.common.Daten_zu_InfluxDB.SourceAnalytixStromDatenAktuellJS: Starting "verbrauch,energie=strom" logging to http://iobtest:8086 into bucket "Langzeit" by org ioBrokerData
      2023-10-26 08:36:35.518  - info: javascript.1 (1780236) script.js.common.Daten_zu_InfluxDB.Heizung_RaumTempJS: Starting "heizung" logging to http://iobtest:8086 into bucket "test-48h" by org ioBrokerData
      2023-10-26 08:37:00.089  - info: javascript.0 (1780041) script.js.common.NSPanel.Powercard: Powercard
      2023-10-26 08:38:00.038  - info: javascript.0 (1780041) script.js.common.NSPanel.Powercard: Powercard
      2023-10-26 08:39:00.034  - info: javascript.0 (1780041) script.js.common.NSPanel.Powercard: Powercard
      
      

      iobroker Einstellungen
      Bildschirmfoto 2023-10-26 um 08.46.54.png

      Raspi-config
      Bildschirmfoto 2023-10-26 um 08.48.58.png
      Bildschirmfoto 2023-10-26 um 08.50.36.png
      Bildschirmfoto 2023-10-26 um 08.51.23.png

      haus-automatisierung 1 Reply Last reply Reply Quote 0
      • haus-automatisierung
        haus-automatisierung Developer Most Active @TT-Tom last edited by haus-automatisierung

        @tt-tom sagte in Konvertierung Datum mit formatDate():

        Nach meinen Tests geht der ioBroker von einem englischen Datum aus, obwohl die Einstellungen im Broker und Raspi auf Deutsch zeigen.

        Richtig, das wird einfach mit new Date(...) intern geparst. Ergo wird nur das erkannt, was Date auch versteht. Die Zeitzonen-Einstellungen des Hosts sind dabei komplett irrelevant. Der gleiche Code soll ja auch schließlich auf allen Systemen identisch funktionieren - wäre ja sonst total seltsam.

        dateString
        A string value representing a date, specified in a format recognized by the Date.parse() method. (These formats are IETF-compliant RFC 2822 timestamps, and also strings in a version of ISO8601.)

        Habe ich hier auch schon dokumentiert:

        https://github.com/ioBroker/ioBroker.javascript/issues/980

        klein0r created this issue in ioBroker/ioBroker.javascript

        open getDateObject doesn't recognize configured date format #980

        T 1 Reply Last reply Reply Quote 1
        • T
          TT-Tom @haus-automatisierung last edited by

          @haus-automatisierung
          danke für die Rückmeldung. Also ist es sinnvoll zur Zeit "moment" zu nutzen?

          haus-automatisierung 1 Reply Last reply Reply Quote 0
          • haus-automatisierung
            haus-automatisierung Developer Most Active @TT-Tom last edited by

            @tt-tom sagte in Konvertierung Datum mit formatDate():

            Also ist es sinnvoll zur Zeit "moment" zu nutzen?

            Wenn genau das deine Anforderung ist, ja. Muss man dann halt als npm Abhängigkeit in den Instanz-Einstellungen des JavaScript-Adaptes hinzufügen und importieren. Ist nicht im Standard enthalten.

            Die Frage ist ja, woher kommt das Datum in diesem Format? Normalerweise sollte das nicht für eine bestimmte Region lesbar gespeichert werden, wenn man damit noch weiterarbeiten möchte.

            T 1 Reply Last reply Reply Quote 0
            • T
              TT-Tom @haus-automatisierung last edited by

              @haus-automatisierung

              der Ursprung ist der ical-Adapter wo die Mülldaten in einem JSON ausgeben werden. Dieses Json wird dann ausgelesen und in 0_userdata Datenpunkte für die Weiterverarbeitung geschrieben (als String). Link zum Script

              haus-automatisierung 1 Reply Last reply Reply Quote 0
              • haus-automatisierung
                haus-automatisierung Developer Most Active @TT-Tom last edited by

                @tt-tom Okay,

                1. bin ich natürlich schwer enttäuscht, dass dafür nicht mein TrashSchedule-Adapter genutz wird 🙂
                2. stehen doch im JSON des iCal-Adapters die Daten nicht als dd.mm.yyyy, sondern können normal geparst werden?!
                T 1 Reply Last reply Reply Quote 1
                • T
                  TT-Tom @haus-automatisierung last edited by TT-Tom

                  @haus-automatisierung

                  Zu 1. privat nutze ich den natürlich, grade wegen der Vis Einbindung 😊

                  Zu 2. die Weiterverarbeitung erfolgt in dem Script von @Armilar für das NSPanel. Bin mit ihm im Kontakt, wo wir Anpassungen durchführen.

                  OliverIO haus-automatisierung 2 Replies Last reply Reply Quote 0
                  • OliverIO
                    OliverIO @TT-Tom last edited by

                    @tt-tom

                    so wie ich es sehe geht der ical adapter rein nur von einem deutschen datum aus.
                    https://github.com/iobroker-community-adapters/ioBroker.ical/blob/ec0deb8ecb2912647cba747f63dd328b8bceac06/main.js#L1377C1-L1377C1

                    andere lokalizationen sind nicht vorgesehen. dadurch kann der adapter eigentlich nur im deutschsprachigen raum verwendet werden.

                    du könntest momentjs verwenden um das datum wieder zu parsen
                    https://momentjs.com/docs/#/parsing/string-format/
                    und dann in javascript weiterzuverwenden

                    haus-automatisierung 1 Reply Last reply Reply Quote 1
                    • haus-automatisierung
                      haus-automatisierung Developer Most Active @OliverIO last edited by haus-automatisierung

                      @oliverio sagte in Konvertierung Datum mit formatDate():

                      dadurch kann der adapter eigentlich nur im deutschsprachigen raum verwendet werden.

                      Mh? Geht es um die HTML-Darstellung? Im JSON kann man jedenfalls wunderbar mit allen Werten arbeiten (mache ich ja im TrashSchedule auch so). Beispiel-JSON aus ical.0.data.table

                      Das kann man alles mit Date parsen:

                      [
                          {
                              "date": "Heute  ",
                              "event": "Biotonne",
                              "_class": "ical_muell ical_today",
                              "_date": "2023-10-25T22:00:00.000Z",
                              "_end": "2023-10-26T22:00:00.000Z",
                              "_IDID": "317008@mymuell.de",
                              "_allDay": true,
                              "_private": false,
                              "_rule": " ",
                              "location": "",
                              "_calName": "muell",
                              "_calColor": "#000000",
                              "_object": {
                                  "type": "VEVENT",
                                  "params": [],
                                  "start": "2023-10-25T22:00:00.000Z",
                                  "datetype": "date",
                                  "end": "2023-10-26T22:00:00.000Z",
                                  "dtstamp": "2023-10-25T22:00:16.000Z",
                                  "uid": "317008@mymuell.de",
                                  "created": "2022-12-09T11:10:27.000Z",
                                  "lastmodified": "2022-12-09T10:11:38.000Z",
                                  "sequence": "0",
                                  "status": "CONFIRMED",
                                  "summary": "Biotonne",
                                  "transparency": "OPAQUE",
                                  "method": "PUBLISH"
                              }
                          }
                      ]
                      
                      OliverIO 2 Replies Last reply Reply Quote 0
                      • OliverIO
                        OliverIO @haus-automatisierung last edited by

                        @haus-automatisierung

                        ne der iCal-Adapter schreibt in den Datenpunkt direkt das Datum im deutschen Format rein.
                        Daher hat der TE nun Schwierigkeiten das Datum weiterzuverarbeiten, da er es jetzt erstmal wieder parsen muss.
                        besser wäre es, wenn Adapter Datumswerte in der Speicherung als ISO oder als timestamp verwenden würde. Dann kann man damit weiterarbeiten.
                        In eine lokale Darstellung umwandeln sollte man so etwas immer nur kurz vor der Darstellung in auf einem Bildschirm und dafür hat vis ja dann die entsprechenden widgets, bzw. eine eigene Datum-Formatierfunktion

                        haus-automatisierung 1 Reply Last reply Reply Quote 0
                        • haus-automatisierung
                          haus-automatisierung Developer Most Active @OliverIO last edited by haus-automatisierung

                          @oliverio sagte in Konvertierung Datum mit formatDate():

                          ne der iCal-Adapter schreibt in den Datenpunkt direkt das Datum im deutschen Format rein.

                          ja, in ical.0.data.html und ical.0.data.text, aber nicht in den ical.0.data.table - und der wird ja im Script verwendet. Siehe Auszug oben. Bitte nicht in die falsche Richtung schicken 🙂 Da braucht man nix mit momentjs im Deutschen Format parsen.

                          EDIT: Okay, und im date-Attribut des JSON, aber da kann auch "Heute" oder "Morgen" drin stehen - siehe Beispiel im vorigen Post. Wäre also eh Quatsch das zu parsen.

                          https://github.com/iobroker-community-adapters/ioBroker.ical/blob/ec0deb8ecb2912647cba747f63dd328b8bceac06/main.js#L549-L552

                          Einfach _date statt date nehmen und fertig.

                          1 Reply Last reply Reply Quote 0
                          • haus-automatisierung
                            haus-automatisierung Developer Most Active @TT-Tom last edited by

                            @tt-tom sagte in Konvertierung Datum mit formatDate():

                            Bin mit ihm im Kontakt, wo wir Anpassungen durchführen.

                            Dann ist es einfach:

                            https://github.com/tt-tom17/MyScripts/blob/039d5689937b58ae87ddb0ba3b8f960d3521fc8e/Sonoff_NSPanel/Abfall_to NSPanel.ts#L81

                            Dort einfach eventStartdatum statt eventDatum nutzen. Dann kann man das auch wieder parsen.

                            T 1 Reply Last reply Reply Quote 0
                            • T
                              TT-Tom @haus-automatisierung last edited by

                              @haus-automatisierung
                              @OliverIO

                              Danke für euren Input, damit habe ich erstmal eine Richtung wie wir weiter machen. Muss mich jetzt nur mit @Armilar abstimmen, wie die Daten übergeben werden sollen.

                              1 Reply Last reply Reply Quote 0
                              • OliverIO
                                OliverIO @haus-automatisierung last edited by

                                @haus-automatisierung sagte in Konvertierung Datum mit formatDate():

                                Das kann man alles mit Date parsen:

                                ja, das ist alles ISO.
                                Dann weiß ich nicht von was der TE spricht wenn er auf den iCal-Adapter verweist,
                                woher sein Datum dann wirklich kommt.

                                haus-automatisierung 1 Reply Last reply Reply Quote 0
                                • haus-automatisierung
                                  haus-automatisierung Developer Most Active @OliverIO last edited by

                                  @oliverio sagte in Konvertierung Datum mit formatDate():

                                  woher sein Datum dann wirklich kommt.

                                  Na aus der Date-Property, welche in meinem Beispiel oben zu "Heute" gewandelt wurde, weil meine iCal-Settings das so vorgeben. Da hattest Du ja schon angemerkt, dass da immer ein MM.DD.(YYYY) Format drin landet.

                                  Daher ja der Vorschlag, stattdessen _date zu nutzen, weil das ein ISO-Date ist (und kein formatiertes Datum).

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

                                  Support us

                                  ioBroker
                                  Community Adapters
                                  Donate

                                  964
                                  Online

                                  31.8k
                                  Users

                                  80.0k
                                  Topics

                                  1.3m
                                  Posts

                                  3
                                  15
                                  1120
                                  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