• Resolved donaldpunk

    (@donaldpunk)


    Hi, I am having trouble with the Timestamp. For example I have the value:
    “c_startdate”: 1724860800000
    Normally this would be the date: 2024-08-28 18:00:00

    But when I fetch the c_startdate from the external json-api, I get
    2008-08-30 16:00:00

    I managed to get 18:00:00 but I don’t know what’s wrong with the date? My template-code is written like this:
    {c_startdate:datetime, d.M.Y, H:i:s,7200}

    Please can anybody help? Do I need the Pro-Version?

    Kind regards, Donald

Viewing 1 replies (of 1 total)
  • Plugin Author berkux

    (@berkux)

    Hi Donald,
    1724860800000 is the timestamp in millisconds, 1724860834 is the timestamp in seconds since 1970/1/1.

    The plugin uses for “datetime”
    https://developer.www.ads-software.com/reference/functions/date_i18n/
    This is alwys using sec, not millisec.
    Yet there is no way to divide the timestamp by 1000 with the free JCI plugin.

    Your options:
    1. Change the data
    2. Write a PHP-script parsing the data, modifying the timestamp and delivers JSON you can use with the free JCI plugin.
    3. use the JCI PRO where you can divide. No questions about the pro here, please!

    Thank you,
    Bernhard

    • This reply was modified 7 months ago by berkux.
    • This reply was modified 7 months ago by berkux.
    • This reply was modified 7 months ago by berkux.
Viewing 1 replies (of 1 total)
  • The topic ‘Problems with Timestamps in the JSON-Template’ is closed to new replies.