Navigation

    MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    Calendar seems to be 1 day off?

    Troubleshooting
    2
    5
    2251
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Shockwave last edited by

      My calendar says Independence Day (July 4th), is 6 days away, while today is June 27th. I can see how it could be considered 6 days and change away, but I would think it would read 7 days. At the time I’m writing this, even GMT date is still the same as my local date so nothing with timezones should be interfering that I can think of.

      1 Reply Last reply Reply Quote 0
      • KirAsh4
        KirAsh4 Moderator last edited by

        It counts from ‘the next midnight’ to the date. So today being ‘some time on the 27th’, start counting at midnight tonight. From there, 6 days later lands you at midnight of the 3rd going into the 4th.

        S 1 Reply Last reply Reply Quote 0
        • S
          Shockwave @KirAsh4 last edited by

          @KirAsh4 ok, that makes sense. Thanks for explaining it.

          1 Reply Last reply Reply Quote 0
          • KirAsh4
            KirAsh4 Moderator last edited by KirAsh4

            I do agree though, while programmatically it makes sense, it has tripped me up more than once because of how it’s calculated. Us mere mortals don’t quite count the way computers do …

            1 Reply Last reply Reply Quote 0
            • KirAsh4
              KirAsh4 Moderator last edited by

              It gets worse when you use the urgency flag with an absolute configuration. The urgency flag changes some of the events to relative times while leaving the rest to absolute. So it might say an event is in 3 days, but when I look at the absolute date, in my mind, it’s 4 days away. It’s simply how we count from an arbitrary time frame versus how a computer counts from a fixed point, that being midnight. The joys of programming.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy