Scripts don't set date correctly

  • qam1

    qam1 - 2013-08-02

    I noticed a probable bug in the scripts

    For some reason in whenever you use core.setDate, core.setDate("Now") or core.setJDay it doesn't set the date correctly. The time is off.

    For example if you set the Date

    core.setDate("2013-08-01T00:00:00", "local");

    it will set the date as 2013-07-31 Time 23:58:53

    It's a minute off which is not horrible but the further you go forward the bigger the error becomes. By the year 2500 it's off by about a half hour, by the year 3000 it's an hour and 20 minutes.

    The error doesn't seem to worsen going back in time.

    Here's a simple script to see

    // Name: Set Date
    // License: Public Domain
    // Author: Qam1
    // Description: Sets Date

    core.setDate("3000-08-01T00:00:00", "local");


    Doing the reverse core.getDate there still an error and it gets the date ahead.
    I.e. if you manually set the date to 2013-08-01T00:00:00 it will "get" 2013-08-01T00:01:03

    For some reason the scripts and main program aren't on the same page with regards to dates

    This bug is in both versions 0.12.0 and 0.12.1, 32 & 64 Bit. Stellarium version 0.11.4 works fine.

    I will put it in the bug reports if it's not an error on my part.

    Since 0.12.0 Stellarium changed the way it advanced dates by sidereal vs solar dates, could this be caused by the changes?

  • Alexander Wolf

    Alexander Wolf - 2013-08-02

    Since 0.12.0 Stellarium use DeltaT correction for time. You can apply DeltaT correction for core.setDate() method (e.g. core.setDate("2013-08-01T00:00:00", "local", true);) or just disable correction - core.setDeltaTAlgorithm("WithoutCorrection");

  • qam1

    qam1 - 2013-08-04

    The core.setDeltaTAlgorithm("WithoutCorrection") doesn't work, the script stops and you get an error in the log file

    "script error: "TypeError: Result of expression 'core.setDeltaTAlgorithm' [undefined] is not a function." @ line 8"

    and the reverse core.getDeltaTAlgorithm doesn't work either

    Adding "true" to core.setDate does work, well mostly, my simple scripts it does but the more complex ones it's going to be a nightmare to redesign them

    Can you fix the core.setDeltaTAlgorithm("WithoutCorrection") or change it back? I don't see why anybody setting time would want a different time.

    Also I thought Delta T can't be accurately determined in the future and they are adding leap seconds anyhow.

  • Alexander Wolf

    Alexander Wolf - 2013-08-04

    core.setDeltaTAlgorithm() and core.getDeltaTAlgorithm() was introduced since version 0.12.2.

    We can set value "true" by default for Delta T for core.setDate() of course.

  • qam1

    qam1 - 2013-08-18

    I just downloaded 0.12.2 and I see you got rid of this for the core.setDate(), that is
    core.setDate() once again sets the date you set without the DeltaT correction.

    However core.getDate() still gets the date with the correction, so it's not consistent.
    core.setDeltaTAlgorithm("WithoutCorrection") does work and you can get the exact date by employing it.

    Oh and Thank you for fixing the core.wait() integer bug in the 64 bit versions.



Cancel  Add attachments