From ecb28155a6afcbe4c50ebe8e6bc112ff884af48a Mon Sep 17 00:00:00 2001 From: Clay Smith Date: Tue, 1 Aug 2023 01:01:56 -0500 Subject: First commit --- notes/time_calculations.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 notes/time_calculations.txt (limited to 'notes/time_calculations.txt') 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) -- cgit v1.2.1