Calendar seems to be 1 day off?



  • 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.


  • Moderator

    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.



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


  • Moderator

    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 …


  • Moderator

    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.


Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.