| 1 | == Time == |
| 2 | = Introduction = |
| 3 | This blueprint deals with the methods for storing times. |
| 4 | |
| 5 | = Saving Times = |
| 6 | All times will be converted into UTC before being saved in the database. |
| 7 | |
| 8 | = Time Settings = |
| 9 | '''Server UTC Offset''' |
| 10 | The time difference between the computer on which the instance is installed (whether it is a server or a normal PC/Laptop) and UTC. This needs to be set by the admin installing the instance. |
| 11 | Q: Would it be possible to write some JS that checks the time on the server against UTC and automatically calculates the offset? Would require internet. |
| 12 | |
| 13 | '''Default User UTC Time Offset''' |
| 14 | The default time difference between ''most'' users and UTC. |
| 15 | |
| 16 | '''User UTC Time Offset''' |
| 17 | (This will override the Default User UTC Time Offset if specified for a user) |
| 18 | The time difference between a specific user and UTC. |
| 19 | Q: Would it be possible to write some JS that checks the time on the user's computer against UTC and automatically calculates the offset? Would require internet. |
| 20 | |
| 21 | = The Issue of Absolute vs. Relative Times = |
| 22 | Where time data is used by the framework of the data, eg. for synchronization absolute (UTC) times should be used. However in some cases data entered by the users will contain time data about an event which is relative to the time zone. |
| 23 | |
| 24 | Use Case: |
| 25 | A security incident is reported in Afghanistan at 10.47am local time. A security analyst would want to know the local time that happened (as well as perhaps the UTC time). |
| 26 | |
| 27 | Solutions: |
| 28 | 1. Tag ALL time data with the UTC offset |
| 29 | || + || - || |
| 30 | || Bulletproof || Time consuming to implement || |
| 31 | || || Extra data overhead when not required || |
| 32 | |
| 33 | 2. Make sure that any table which contains time data which is relative, also contains a location where the , which includes UTC offset data. |
| 34 | || + || - || |
| 35 | || No framework mods req. ||requires specific implementation each time || |
| 36 | |
| 37 | It may also be useful to have some sort of flag/config setting that allows the time to be displayed as local/local relative to where it occured/UTC |