MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Calendar seems to be 1 day off?

    Scheduled Pinned Locked Moved Troubleshooting
    5 Posts 2 Posters 2.8k Views 1 Watching
    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 Offline
      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
      • KirAsh4K Offline
        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.

        A Life? Cool! Where can I download one of those from?

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

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

          1 Reply Last reply Reply Quote 0
          • KirAsh4K Offline
            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 …

            A Life? Cool! Where can I download one of those from?

            1 Reply Last reply Reply Quote 0
            • KirAsh4K Offline
              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.

              A Life? Cool! Where can I download one of those from?

              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 Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy