-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTime.py
75 lines (45 loc) · 1.16 KB
/
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
75
import datetime
import time
def time_status(): # done
hour = int(datetime.datetime.now().hour)
# print(hour)
if hour >= 0 and hour<12:
tme = 'Morning'
elif hour >= 12 and hour<18:
tme = 'afternoon'
else:
tme = 'evening'
return tme
# done
def timer(count):
count = int(count)
print('Satarted 😊')
while count>=0:
# print(count)
time.sleep(1)
count = count-1
print('Timer is over now !')
# for x in range(0,count+1):
# print(x)
# time.sleep(1)
# done
def get_current_time():
wkt = datetime.datetime.now()
current_time = wkt.strftime('%H,%M minutes and %S seconds')
hh,rest = current_time.split(',')
status = 'AM'
if int(hh) > 12:
hh = int(hh)-12
status = 'PM'
current_time = str(hh)+' '+status+' '+rest
return current_time
if __name__ == '__main__':
# count = time_status()
# print(f"Good {time}.")
# timer(12)
# print(reminder())
# set_reminder(set_date='2020-06-30',set_time='22:02:20',task='test')
time=get_current_time()
print(time)
# with Listener(on_press=stopwatch) as l:
# l.join()