Synology log server - fix for UTC time introduced a date issue

Issue #18 resolved
Roger Stoffers created an issue

Hi Arie,

After the fix for UTC to synology log server (thanks!) I think a new problem is introduced:

The DATE is now 2 days in the future.

See attached screenshot. The fix was introduced on my Homey on 13/5. There you see the timestamps change from 22:01->0:01 (perfect!) but the date goes from 11 (2 days too early) ->15/5 (2 days too late, so in the future).

Best!

Comments (19)

  1. arie repo owner

    Okay, please goto the BLL App settings and show (printscreen please) me the ISOZ value:

  2. arie repo owner

    Okay, send a log and show me a printscreen of Synology and the SimpleLog appsettings please of that logline.

  3. arie repo owner

    And, install the current test version, put on the new Debug setting in the App Settings, and then repeat the steps (send a log) and then send me a diagnostic.

  4. arie repo owner

    So its resolved now?

    I didn't change anything, except build in the new debugger, but that really shouldn't matter.

    I'll close this ticket, if you have another issue, let me know

  5. Roger Stoffers reporter
    • changed status to open

    Hi Arie, Still something is off. Today on Log Viewer I can see lines written today, but these are dated 17/5 (and today is 15/5).

    Roger

  6. arie repo owner

    Okay, put hte App Setting Debug on, send a log to the Synology, and if it’s wrong, send me a diagnostic.

  7. Roger Stoffers reporter

    Will the diag also show info from 0:01am last night/tomorrow night? There are only 3 lines every day which have this issue ?!??

    The flow for these 3 lines is:

    The flow for any of the other lines is:

    I cannot tell the difference.

  8. arie repo owner

    send me a diag?
    I already have a report that time is send as 24:01 instead of 00:01.

    That might cause this issue.

    I plan pon testing it tonight between 00:00 and 02:00 my time, thats where issues seems to apear.

  9. arie repo owner

    Okay, in English, when you request the Hours in a non-12-hour format, you will get 24:xx.

    This is the definition for english.
    I have change this, because it will mess up what people would want!
    Update BLL to resolve this issue!
    And let me know if it works

    To see this, try these 2 codes in HomeyScript:

    let date = new Date();
    date = date.setHours(date.getHours()+5);
    date = new Date(date);
    let a = date.toLocaleString('EN' || this.locale || DateTime.locale, {hour:'2-digit', hour12:false });
    return a;
    

    will return 24
    and then

    let date = new Date();
    date = date.setHours(date.getHours()+5);
    date = new Date(date);
    let a = date.toLocaleString('EN' || this.locale || DateTime.locale, {hour:'2-digit', hourCycle:'h23' });
    return a;
    

    Will return 00

  10. Roger Stoffers reporter

    Just out of curiosity: how does a ‘24h’ issue lead to writing log lines 2 DAYS forward?

  11. arie repo owner

    I have no idea, and i am not sure.

    But synology might just handle it wrong that way.

    Fact is: You use the locale (EN_) which causes this issue, and the wrong lines are exactly within that periode, so i am asuming this solves it.

    The ISO should never send 24:xx as time, so i think it goes wrong because of that.

  12. arie repo owner

    And after 24:xx, the date does go forward one day ofc, but how does it handle the time than?
    Not sure, but this shoudl solve it it think.

  13. Log in to comment