From: Kevin Day Date: Fri, 16 Dec 2022 00:33:14 +0000 (-0600) Subject: Cleanup: Bring a copy of time.txt from Controller to the core project. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=ea6d88bfc253d0c88a56632b4240c51c8eda42da;p=fll Cleanup: Bring a copy of time.txt from Controller to the core project. New functionality needs to be added to the package.sh script to conditionally add documentation and specifications to any given package. Once this is done, then the now redundant time.txt can be removed from the Controller and possibly Control projects. There also needs to be a formally specification file for time.txt and not just documentation. --- diff --git a/documents/time.txt b/documents/time.txt new file mode 100644 index 0000000..53f8027 --- /dev/null +++ b/documents/time.txt @@ -0,0 +1,43 @@ +# fss-0002 +# +# license: open-standard-license-1.0 +# + +Time Documentation: + The FLL project and relating programs might utilize the unit of measurement called a "Time", represented with uppercase "T". + For comparison, a unit of Time is equivalent to a nanosecond, or 10^-9 seconds. + A MegaTime (MT) is therefore equivalent to a millisecond such that a millisecond is 10^-3 seconds. + + A unit of Time is intended to represent some unit of Time such that a single 64-bit integer may hold all units of Time for a single calendar year. + This unit of Time does not and must not include Years (unlike Unixtime). + To convert from Time to Unixtime, one must have a year (which could be assumed to be the current year) and then calculate all of those calendar oddities. + + A unit of Time by default is assumed to be in UTC. + 1 (Earth) year ~= 31536000000000000 Time or 31536000 GT (GigaTime). + 1 (Earth) day = 86400000000000 Time or 86400 GT (GigaTime). + 1 (Earth) hour = 3600000000000 Time or 3600 GT (GigaTime). + 1 (Earth) minute = 60000000000 Time or 60 GT (GigaTime). + 1 (Earth) second = 1000000000 Time or 1 GT (GigaTime). + + Consequentially, 1 day is easily represented in units of Time as 86.4 TT (TeraTime). + + The Time may be stored in its "year string format". + In this format, a Year may be prepended to the Time followed by a single colon ':' to associate a year with the Time. + This Year has no minimum or maximum but may not have decimals. + For example, "2020:86400000000000" would represent: January 02, 2020 0:00 UTC. + For example, "2020:86.4 TT" would represent: January 02, 2020 0:00 UTC. + + A second unit of Time, called EpochTime, works the same way as Time except it represents seconds. + This unit is designated "E". + The format is similar to Time, except there are two colons: "1970::1620874738" would represent: May 13, 2021 2:58:58 UTC. + When the year is not specified, then this is identical to UNIX Epoch. + + A unit of EpochTime by default is assumed to be in UTC. + 1 (Earth) year ~= 31536000 EpochTime or 31.536 GE (GigaEpochTime). + 1 (Earth) day = 86400 EpochTime + 1 (Earth) hour = 3600 EpochTime + 1 (Earth) minute = 60 EpochTime + 1 (Earth) second = 1 EpochTime + 1 GT (GigaTime) = 1 EpochTime + + Consequentially, 1 day is easily represented in units of EpochTime as 86.4 KE (KiloEpochTime).