-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTIME program
41 lines (34 loc) · 1.06 KB
/
TIME program
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
import time
def get_time():
epoch_time = time.time()
total_seconds = int(epoch_time)
current_second = total_seconds % 60
total_minutes = total_seconds//60
current_minutes = total_minutes % 60
total_hours = total_minutes//60+1
current_hour = total_hours % 24
current_time = str(current_hour) + ":" + str(current_minutes) + ":" + str(current_second)
return current_time
print("TIME NOW IS ", get_time())
Bonus:
import time
def my_infos():
print(" ")
print("My Name is : Toufik CHALOULI")
print(" ")
print(" I'm 33 years Old")
print(" ")
print(" I'm A Gamer ♥")
my_infos()
def get_time():
epoch_time = time.time()
total_seconds = int(epoch_time)
current_second = total_seconds % 60
total_minutes = total_seconds//60
current_minutes = total_minutes % 60
total_hours = total_minutes//60+1
current_hour = total_hours % 24
current_time = str(current_hour) + ":" + str(current_minutes) + ":" + str(current_second)
return current_time
print(" ")
print(" ",get_time())