-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbetter_spoken_time.py
74 lines (71 loc) · 2.16 KB
/
better_spoken_time.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/python
import time
if int(time.strftime("%d")) == 1:
suffixed = 'first'
elif int(time.strftime("%d")) == 2:
suffixed = 'second'
elif int(time.strftime("%d")) == 3:
suffixed = 'third'
elif int(time.strftime("%d")) == 4:
suffixed = 'fourth'
elif int(time.strftime("%d")) == 5:
suffixed = 'fifth'
elif int(time.strftime("%d")) == 6:
suffixed = 'sixth'
elif int(time.strftime("%d")) == 7:
suffixed = 'seventh'
elif int(time.strftime("%d")) == 8:
suffixed = 'eighth'
elif int(time.strftime("%d")) == 9:
suffixed = 'ninth'
elif int(time.strftime("%d")) == 10:
suffixed = 'tenth'
elif int(time.strftime("%d")) == 11:
suffixed = 'eleventh'
elif int(time.strftime("%d")) == 12:
suffixed = 'twelfth'
elif int(time.strftime("%d")) == 13:
suffixed = 'thirteenth'
elif int(time.strftime("%d")) == 14:
suffixed = 'fourteenth'
elif int(time.strftime("%d")) == 15:
suffixed = 'fifteenth'
elif int(time.strftime("%d")) == 16:
suffixed = 'sixteenth'
elif int(time.strftime("%d")) == 17:
suffixed = 'seventeeth'
elif int(time.strftime("%d")) == 18:
suffixed = 'eighteenth'
elif int(time.strftime("%d")) == 19:
suffixed = 'nineteenth'
elif int(time.strftime("%d")) == 20:
suffixed = 'twentieth'
elif int(time.strftime("%d")) == 21:
suffixed = 'twentyfirst'
elif int(time.strftime("%d")) == 22:
suffixed = 'twentysecond'
elif int(time.strftime("%d")) == 23:
suffixed = 'twentythird'
elif int(time.strftime("%d")) == 24:
suffixed = 'twenty fourth'
elif int(time.strftime("%d")) == 25:
suffixed = 'twenty fifth'
elif int(time.strftime("%d")) == 26:
suffixed = 'twenty sixth'
elif int(time.strftime("%d")) == 27:
suffixed = 'twenty seventh'
elif int(time.strftime("%d")) == 28:
suffixed = 'twenty eigth'
elif int(time.strftime("%d")) == 29:
suffixed = 'twenty ninth'
elif int(time.strftime("%d")) == 30:
suffixed = 'thirtieth'
elif int(time.strftime("%d")) == 31:
suffixed = 'thirty first'
now = time.strftime("%A %B ") + suffixed + " and the time is " + time.strftime(" %H %M")
if int(time.strftime("%H")) < 12:
period = ' morning '
elif int(time.strftime("%H")) >= 12:
period = ' afternoon '
elif int(time.strftime("%H")) >= 17:
period = ' evening '