Skip to content

Instantly share code, notes, and snippets.

@DoubleF3lix
Last active January 6, 2022 20:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DoubleF3lix/a03afde0a979dfa41e8525ee92f12ca5 to your computer and use it in GitHub Desktop.
Save DoubleF3lix/a03afde0a979dfa41e8525ee92f12ca5 to your computer and use it in GitHub Desktop.

Here's the animation controller I used: https://gist.github.com/DoubleF3lix/3b904f6d527e2c12e6633d3335abe130
Here's the entity I used: https://gist.github.com/DoubleF3lix/a5793a79aa353dd9041b22b9fcd44504
I used this function to start the whole process: https://gist.github.com/DoubleF3lix/cf5ae53cfe1eb1c87189a9e869bfc604

I placed a large row of command blocks starting at 0 72 -1 and extending all the way to 100 73 -1, each containing time query daytime. After running the start function, a redstone block was placed at each command block.

After an entire day cycled through, here's the data:

query.time_of_day Day Time Corrected Day Time
0.00 18002 18000
0.01 18242 18240
0.02 18482 18480
0.03 18722 18720
0.04 18962 18960
0.05 19202 19200
0.06 19442 19440
0.07 19682 19680
0.08 19922 19920
0.09 20164 20162
0.10 20402 20400
0.11 20642 20640
0.12 20882 20880
0.13 21122 21120
0.14 21362 21360
0.15 21604 21602
0.16 21842 21840
0.17 22082 22080
0.18 22324 22322
0.19 22562 22560
0.20 22802 22800
0.21 23042 23040
0.22 23282 23280
0.23 23522 23520
0.24 23762 23760
0.25 2 0
0.26 242 240
0.27 482 480
0.28 722 720
0.29 962 960
0.30 1204 1202
0.31 1442 1440
0.32 1682 1680
0.33 1924 1922
0.34 2162 2160
0.35 2402 2400
0.36 2644 2642
0.37 2882 2880
0.38 3122 3120
0.39 3362 3360
0.40 3602 3600
0.41 3842 3840
0.42 4082 4080
0.43 4322 4320
0.44 4562 4560
0.45 4802 4800
0.46 5042 5040
0.47 5282 5280
0.48 5522 5520
0.49 5762 5760
0.50 6002 6000
0.51 6242 6240
0.52 6482 6480
0.53 6722 6720
0.54 6962 6960
0.55 7202 7200
0.56 7442 7440
0.57 7682 7680
0.58 7922 7920
0.59 8162 8160
0.60 8404 8402
0.61 8642 8640
0.62 8882 8880
0.63 9122 9120
0.64 9362 9360
0.65 9602 9600
0.66 9844 9842
0.67 10082 10080
0.68 10322 10320
0.69 10562 10560
0.70 10802 10800
0.71 11042 11040
0.72 11284 11282
0.73 11522 11520
0.74 11762 11760
0.75 12002 12000
0.76 12242 12240
0.77 12482 12480
0.78 12722 12720
0.79 12964 12962
0.80 13202 13200
0.81 13442 13440
0.82 13682 13680
0.83 13922 13920
0.84 14162 14160
0.85 14404 14402
0.86 14642 14640
0.87 14882 14880
0.88 15122 15120
0.89 15362 15360
0.90 15602 15600
0.91 15844 15842
0.92 16082 16080
0.93 16322 16320
0.94 16562 16560
0.95 16802 16800
0.96 17042 17040
0.97 17284 17282
0.98 17522 17520
0.99 17762 17760
1.00 18002 18000

Since we know that 0.00 or 1.00 is equal to 18000, not 18002, and we also know for sure that 0.25 is 0, not 2, we can correct these times by subtracting 2 from all times. These values are contained in the "Corrected Day Time" column. From this data, we can get the following equation:

formula

To go the other way around, we just reverse the equation:

formula


Here's the data in list format if you need to use it in code:

[["0.00", "18002"], ["0.01", "18242"], ["0.02", "18482"], ["0.03", "18722"], ["0.04", "18962"], ["0.05", "19202"], ["0.06", "19442"], ["0.07", "19682"], ["0.08", "19922"], ["0.09", "20164"], ["0.10", "20402"], ["0.11", "20642"], ["0.12", "20882"], ["0.13", "21122"], ["0.14", "21362"], ["0.15", "21604"], ["0.16", "21842"], ["0.17", "22082"], ["0.18", "22324"], ["0.19", "22562"], ["0.20", "22802"], ["0.21", "23042"], ["0.22", "23282"], ["0.23", "23522"], ["0.24", "23762"], ["0.25", "2"], ["0.26", "242"], ["0.27", "482"], ["0.28", "722"], ["0.29", "962"], ["0.30", "1204"], ["0.31", "1442"], ["0.32", "1682"], ["0.33", "1924"], ["0.34", "2162"], ["0.35", "2402"], ["0.36", "2644"], ["0.37", "2882"], ["0.38", "3122"], ["0.39", "3362"], ["0.40", "3602"], ["0.41", "3842"], ["0.42", "4082"], ["0.43", "4322"], ["0.44", "4562"], ["0.45", "4802"], ["0.46", "5042"], ["0.47", "5282"], ["0.48", "5522"], ["0.49", "5762"], ["0.50", "6002"], ["0.51", "6242"], ["0.52", "6482"], ["0.53", "6722"], ["0.54", "6962"], ["0.55", "7202"], ["0.56", "7442"], ["0.57", "7682"], ["0.58", "7922"], ["0.59", "8162"], ["0.60", "8404"], ["0.61", "8642"], ["0.62", "8882"], ["0.63", "9122"], ["0.64", "9362"], ["0.65", "9602"], ["0.66", "9844"], ["0.67", "10082"], ["0.68", "10322"], ["0.69", "10562"], ["0.70", "10802"], ["0.71", "11042"], ["0.72", "11284"], ["0.73", "11522"], ["0.74", "11762"], ["0.75", "12002"], ["0.76", "12242"], ["0.77", "12482"], ["0.78", "12722"], ["0.79", "12964"], ["0.80", "13202"], ["0.81", "13442"], ["0.82", "13682"], ["0.83", "13922"], ["0.84", "14162"], ["0.85", "14404"], ["0.86", "14642"], ["0.87", "14882"], ["0.88", "15122"], ["0.89", "15362"], ["0.90", "15602"], ["0.91", "15844"], ["0.92", "16082"], ["0.93", "16322"], ["0.94", "16562"], ["0.95", "16802"], ["0.96", "17042"], ["0.97", "17284"], ["0.98", "17522"], ["0.99", "17762"], ["1.00", "18002"]]

As separate arrays:

x = [0.0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.2, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.3, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.4, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.5, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.6, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.7, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.8, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.9, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.0]
y = [18002, 18242, 18482, 18722, 18962, 19202, 19442, 19682, 19922, 20164, 20402, 20642, 20882, 21122, 21362, 21604, 21842, 22082, 22324, 22562, 22802, 23042, 23282, 23522, 23762, 2, 242, 482, 722, 962, 1204, 1442, 1682, 1924, 2162, 2402, 2644, 2882, 3122, 3362, 3602, 3842, 4082, 4322, 4562, 4802, 5042, 5282, 5522, 5762, 6002, 6242, 6482, 6722, 6962, 7202, 7442, 7682, 7922, 8162, 8404, 8642, 8882, 9122, 9362, 9602, 9844, 10082, 10322, 10562, 10802, 11042, 11284, 11522, 11762, 12002, 12242, 12482, 12722, 12964, 13202, 13442, 13682, 13922, 14162, 14404, 14642, 14882, 15122, 15362, 15602, 15844, 16082, 16322, 16562, 16802, 17042, 17284, 17522, 17762, 18002]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment