github.com/simpleiot/simpleiot@v0.18.3/docs/adr/6-time-storage-in-rule-schedule.md (about)

     1  # Time storage in rule schedules
     2  
     3  - Author: Cliff Brake, last updated: 2023-07-10
     4  - PR/Discussion:
     5  - Status: discussion
     6  
     7  ## Problem
     8  
     9  When storing times/dates in rule schedules, we store time as UTC, but this can
    10  be problematic when there is a time change. In once application, SIOT plays a
    11  chime at a certain time of day, but when time changes (daylight savings time),
    12  we need to adjust the time in the rule and this is easy to forget.
    13  
    14  ## Context/Discussion
    15  
    16  UTC was chosen as the storage format for the following reasons:
    17  
    18  - it is universal -- it always means the same thing everywhere
    19  - typically in UI or reports, times are translated to users local times
    20  - server and edge devices can operate in UTC without needing to worry about
    21    local time
    22  - rules run on cloud instances have a common timebase to work from. In a highly
    23    distributed system, you may have device in one timezone trigger an action in
    24    another time zone.
    25  
    26  However, must applications (building automation, etc.) run in a single location,
    27  and the loss or gain of an hour when the time changes is very inconvenient.
    28  
    29  ### Reference/Research
    30  
    31  - [TMPDIR Forum discusion](https://community.tmpdir.org/t/daylight-savings-time-dst-in-iot-applications/1092)
    32  
    33  ## Decision
    34  
    35  what was decided.
    36  
    37  objections/concerns
    38  
    39  ## Consequences
    40  
    41  what is the impact, both negative and positive.
    42  
    43  ## Additional Notes/Reference