diff options
Diffstat (limited to 'notes/time_calculations.txt')
-rw-r--r-- | notes/time_calculations.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/notes/time_calculations.txt b/notes/time_calculations.txt new file mode 100644 index 0000000..d623026 --- /dev/null +++ b/notes/time_calculations.txt @@ -0,0 +1,19 @@ +time is always 4 digits longs with a colon seperating hour and minutes: +minutes are directly correlated in both times, no conversion needed (right two digits) +remove colon from number +add any leading 0s as necessary to fit 4 spaces: XXXX (04:43 AM -> 0443) (done in a later printf) (for now, 443) + + +12 AM - 12:59 AM = just add the minutes + + +1:00 AM - 12:59 PM = add the minutes and add (100 * number left of colon) (Example 3:42 AM -> (42 + (3 * 100)) => 342) +(another example: 12:16 PM -> (16 + (12 * 100) => 1216) + + +1 PM - 11:59 PM = add the minutes and add ((12 + number left of colon) * 100) +example: 3:33 PM -> 33 + (3 + 12) * 100 => 1533 + + +longest string = 12:12 PM - 12:12 AM (19 characters) +shortest string = 1 AM - 2 PM (11 characters) |