▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
This program converts any time of day into Ship’s Bell Time!
Ship’s Bell Time is a system of time-keeping that has been used aboard marine vessels since as early as the 1400s and is still in-use today! This system divides the day (24hrs) into 7 “watches”.
WATCH | START | END |
---|---|---|
First | 20:00 | 00:00 |
Middle | 00:00 | 04:00 |
Morning | 04:00 | 08:00 |
Forenoon | 08:00 | 12:00 |
Afternoon | 12:00 | 16:00 |
First Dog | 16:00 | 18:00 |
Second Dog | 18:00 | 20:00 |
The progress of each watch is announced every 30 minutes by ringing the ship bell. For example, consider a 4 hour watch. After the first 30 minutes, the bell is rung once for “First Bell”. After the next 30 minutes the bell is rung twice for “Two Bells”. After 30 more minutes it’s rung thrice “Three Bells”, and so on. After all 4 hours have passed (8 30min increments) the bell is rung for “Eight Bells” indicating the end of the current watch and the beginning of the next.
Here’s how to use this program to check the watch status for a given time!
# Start by initializing the Schedule() with the target time.
# Pass the target time as a string like (ie. '23:45', '00:28', '15:13', etc.)
= Schedule('20:11')
s # ...or leave it blank and it'll default to current time!
= Schedule()
s
# Use the Schedule() you created to check status of the watch...
= s.current_watch.name
current_watch = s.next_watch.name
next_watch = s.last_watch.name
last_watch
# ...or status of the bell!
= s.next_bell.count
next_bell = s.last_bell.count
last_bell = s.min_to_next_bell
minutes_to_next_bell = s.min_since_last_bell minutes_since_last_bell
Print out current Ship Bell Time in human readable text.
# Initialize Schedule(). Default to current time.
= Schedule()
s
# Access schedule information.
= s.current_watch.name
current_watch = s.min_to_next_bell
min_to_next_bell = s.next_bell.count
next_bell_count
# Print out time as human readable string.
print(f"It's currently {current_watch} watch. {min_to_next_bell} minutes to {next_bell_count} bells.")
# OUTPUT: "It's currently First Dog watch. 3 minutes to 4 bells."