Problem
One day, you boss walks up to you and tells you he needs to know the time. He still insists after you pointing at the clock directly above your head, and confesses he has a severe case of dyscalculia, which causes him to not even be able to see numbers on a clock. While you're still left wondering how someone unable to see numbers can run a company, he tells you to "do something about it", whatever that is.
Your task is now to create a program or function that, given an input time with hours and minutes (seconds are optional)(hours are 24-based), outputs a readable english sentence, that doesn't contain numbers.
It is not necessary to ouput the seconds.
For example, 08:45:15
should output quarter to nine o'clock AM
Test cases
00:00:00 > twelve night
12:00:00 > twelve noon
06:00:00 > six o'clock AM
18:00:00 > six o'clock PM
06:15:00 > quarter past six o'clock AM
18:45:00 > quarter to seven o'clock PM
11:30:00 > half past eleven o'clock AM
13:22:00 > twentytwo minutes past one o'clock PM
17:43:00 > seventeen minutes to six o'clock PM
00:09:00 > nine minutes past twelve o'clock AM
Rules
Outputting numbers can be both in the form of fortytwo or forty-two, whichever you like best. Standard loopholes are not allowed. Trailing newlines are allowed, but the sentence should be on 1 line.
Input can be in any format you want, for example HH:MM:SS
, HH,MM,SS
, HHMMSS
, HH/MM/SS
, or any variant without seconds, but you should make the input format clear in your answer. It's not needed to output one minute
instead of one minutes
for minutes ranging from 0 trough 30 (0 and 30 included) you should use past
, and for the others you should use to
Because time is relative, shortest code in bytes wins.
forty-five
when the test cases clearly statequarter to
as the appropriate input format? (just change it to forty-two ;) ) Also, kolmogorov-complexity is not an appropriate tag. \$\endgroup\$one
totwenty-nine
, withquarter
replacingfifteen
andhalf
representingthirty
, but that's not clear. Also, for future questions, I heartily recommend the Sandbox to work out the kinks before posting. \$\endgroup\$